diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 33acbc6f17a4..6f99136b24d8 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index b0c1dafb9f65..52f644bffe9a 100644 --- a/pom.xml +++ b/pom.xml @@ -923,6 +923,7 @@ sdk/mediaservices sdk/metricsadvisor sdk/mixedreality + sdk/mobilenetwork sdk/modelsrepository sdk/monitor sdk/mysql diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md new file mode 100644 index 000000000000..48d697a794ed --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-19) + +- Azure Resource Manager MobileNetwork client library for Java. This package contains Microsoft Azure SDK for MobileNetwork Management SDK. The resources in this swagger specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance. Package tag package-2022-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md new file mode 100644 index 000000000000..d6ceefdc32bd --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager MobileNetwork client library for Java + +Azure Resource Manager MobileNetwork client library for Java. + +This package contains Microsoft Azure SDK for MobileNetwork Management SDK. The resources in this swagger specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance. Package tag package-2022-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-mobilenetwork + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +MobileNetworkManager manager = MobileNetworkManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/SAMPLE.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/SAMPLE.md new file mode 100644 index 000000000000..5aba43545e8f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/SAMPLE.md @@ -0,0 +1,1658 @@ +# Code snippets and samples + + +## AttachedDataNetworks + +- [CreateOrUpdate](#attacheddatanetworks_createorupdate) +- [Delete](#attacheddatanetworks_delete) +- [Get](#attacheddatanetworks_get) +- [ListByPacketCoreDataPlane](#attacheddatanetworks_listbypacketcoredataplane) +- [UpdateTags](#attacheddatanetworks_updatetags) + +## DataNetworks + +- [CreateOrUpdate](#datanetworks_createorupdate) +- [Delete](#datanetworks_delete) +- [Get](#datanetworks_get) +- [ListByMobileNetwork](#datanetworks_listbymobilenetwork) +- [UpdateTags](#datanetworks_updatetags) + +## MobileNetworks + +- [CreateOrUpdate](#mobilenetworks_createorupdate) +- [Delete](#mobilenetworks_delete) +- [GetByResourceGroup](#mobilenetworks_getbyresourcegroup) +- [List](#mobilenetworks_list) +- [ListByResourceGroup](#mobilenetworks_listbyresourcegroup) +- [ListSimIds](#mobilenetworks_listsimids) +- [UpdateTags](#mobilenetworks_updatetags) + +## Operations + +- [List](#operations_list) + +## PacketCoreControlPlanes + +- [CreateOrUpdate](#packetcorecontrolplanes_createorupdate) +- [Delete](#packetcorecontrolplanes_delete) +- [GetByResourceGroup](#packetcorecontrolplanes_getbyresourcegroup) +- [List](#packetcorecontrolplanes_list) +- [ListByResourceGroup](#packetcorecontrolplanes_listbyresourcegroup) +- [UpdateTags](#packetcorecontrolplanes_updatetags) + +## PacketCoreDataPlanes + +- [CreateOrUpdate](#packetcoredataplanes_createorupdate) +- [Delete](#packetcoredataplanes_delete) +- [Get](#packetcoredataplanes_get) +- [ListByPacketCoreControlPlane](#packetcoredataplanes_listbypacketcorecontrolplane) +- [UpdateTags](#packetcoredataplanes_updatetags) + +## Services + +- [CreateOrUpdate](#services_createorupdate) +- [Delete](#services_delete) +- [Get](#services_get) +- [ListByMobileNetwork](#services_listbymobilenetwork) +- [UpdateTags](#services_updatetags) + +## SimPolicies + +- [CreateOrUpdate](#simpolicies_createorupdate) +- [Delete](#simpolicies_delete) +- [Get](#simpolicies_get) +- [ListByMobileNetwork](#simpolicies_listbymobilenetwork) +- [UpdateTags](#simpolicies_updatetags) + +## Sims + +- [CreateOrUpdate](#sims_createorupdate) +- [Delete](#sims_delete) +- [GetByResourceGroup](#sims_getbyresourcegroup) +- [List](#sims_list) +- [ListByResourceGroup](#sims_listbyresourcegroup) +- [UpdateTags](#sims_updatetags) + +## Sites + +- [CreateOrUpdate](#sites_createorupdate) +- [Delete](#sites_delete) +- [Get](#sites_get) +- [ListByMobileNetwork](#sites_listbymobilenetwork) +- [UpdateTags](#sites_updatetags) + +## Slices + +- [CreateOrUpdate](#slices_createorupdate) +- [Delete](#slices_delete) +- [Get](#slices_get) +- [ListByMobileNetwork](#slices_listbymobilenetwork) +- [UpdateTags](#slices_updatetags) +### AttachedDataNetworks_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; +import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; +import com.azure.resourcemanager.mobilenetwork.models.PortRange; +import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; +import java.util.Arrays; + +/** Samples for AttachedDataNetworks CreateOrUpdate. */ +public final class AttachedDataNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkCreate.json + */ + /** + * Sample code: Create attached data network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createAttachedDataNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .define("TestAttachedDataNetwork") + .withRegion("eastus") + .withExistingPacketCoreDataPlane("rg1", "TestPacketCoreCP", "TestPacketCoreDP") + .withUserPlaneDataInterface(new InterfaceProperties().withName("N6")) + .withNaptConfiguration( + new NaptConfiguration() + .withEnabled(NaptEnabled.ENABLED) + .withPortRange(new PortRange().withMinPort(1024).withMaxPort(65535)) + .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(120).withUdp(60)) + .withPinholeLimits(65536) + .withPinholeTimeouts(new PinholeTimeouts().withTcp(7440).withUdp(300).withIcmp(60))) + .withUserEquipmentAddressPoolPrefix(Arrays.asList("2.2.0.0/16")) + .withUserEquipmentStaticAddressPoolPrefix(Arrays.asList("2.4.0.0/16")) + .create(); + } +} +``` + +### AttachedDataNetworks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks Delete. */ +public final class AttachedDataNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkDelete.json + */ + /** + * Sample code: Delete attached data network resource. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteAttachedDataNetworkResource( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .delete("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE); + } +} +``` + +### AttachedDataNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks Get. */ +public final class AttachedDataNetworksGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkGet.json + */ + /** + * Sample code: Get attached data network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getAttachedDataNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .getWithResponse("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE); + } +} +``` + +### AttachedDataNetworks_ListByPacketCoreDataPlane + +```java +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks ListByPacketCoreDataPlane. */ +public final class AttachedDataNetworksListByPacketCoreDataPlaneSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json + */ + /** + * Sample code: List attached data networks in a data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listAttachedDataNetworksInADataPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .listByPacketCoreDataPlane("rg1", "TestPacketCoreCP", "TestPacketCoreDP", Context.NONE); + } +} +``` + +### AttachedDataNetworks_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AttachedDataNetworks UpdateTags. */ +public final class AttachedDataNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkUpdateTags.json + */ + /** + * Sample code: Update attached data network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateAttachedDataNetworkTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + AttachedDataNetwork resource = + manager + .attachedDataNetworks() + .getWithResponse("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### DataNetworks_CreateOrUpdate + +```java +/** Samples for DataNetworks CreateOrUpdate. */ +public final class DataNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkCreate.json + */ + /** + * Sample code: Create mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .dataNetworks() + .define("testDataNetwork") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withDescription("myFavouriteDataNetwork") + .create(); + } +} +``` + +### DataNetworks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DataNetworks Delete. */ +public final class DataNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkDelete.json + */ + /** + * Sample code: Delete mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().delete("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE); + } +} +``` + +### DataNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DataNetworks Get. */ +public final class DataNetworksGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkGet.json + */ + /** + * Sample code: Get mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().getWithResponse("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE); + } +} +``` + +### DataNetworks_ListByMobileNetwork + +```java +import com.azure.core.util.Context; + +/** Samples for DataNetworks ListByMobileNetwork. */ +public final class DataNetworksListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkListByMobileNetwork.json + */ + /** + * Sample code: List mobile network dataNetworks in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkDataNetworksInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} +``` + +### DataNetworks_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DataNetworks UpdateTags. */ +public final class DataNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkUpdateTags.json + */ + /** + * Sample code: Update data network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateDataNetworkTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + DataNetwork resource = + manager + .dataNetworks() + .getWithResponse("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### MobileNetworks_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.PlmnId; + +/** Samples for MobileNetworks CreateOrUpdate. */ +public final class MobileNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkCreate.json + */ + /** + * Sample code: Create mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .mobileNetworks() + .define("testMobileNetwork") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withPublicLandMobileNetworkIdentifier(new PlmnId().withMcc("001").withMnc("01")) + .create(); + } +} +``` + +### MobileNetworks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for MobileNetworks Delete. */ +public final class MobileNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkDelete.json + */ + /** + * Sample code: Delete mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().delete("rg1", "testMobileNetwork", Context.NONE); + } +} +``` + +### MobileNetworks_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for MobileNetworks GetByResourceGroup. */ +public final class MobileNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkGet.json + */ + /** + * Sample code: Get mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().getByResourceGroupWithResponse("rg1", "testMobileNetwork", Context.NONE); + } +} +``` + +### MobileNetworks_List + +```java +import com.azure.core.util.Context; + +/** Samples for MobileNetworks List. */ +public final class MobileNetworksListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListBySubscription.json + */ + /** + * Sample code: List mobile networks in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworksInASubscription( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().list(Context.NONE); + } +} +``` + +### MobileNetworks_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for MobileNetworks ListByResourceGroup. */ +public final class MobileNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListByResourceGroup.json + */ + /** + * Sample code: List mobile networks in resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworksInResourceGroup( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### MobileNetworks_ListSimIds + +```java +import com.azure.core.util.Context; + +/** Samples for MobileNetworks ListSimIds. */ +public final class MobileNetworksListSimIdsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimIdListByMobileNetwork.json + */ + /** + * Sample code: List sim profile ids by network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimProfileIdsByNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().listSimIds("rg", "testMobileNetworkName", Context.NONE); + } +} +``` + +### MobileNetworks_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MobileNetworks UpdateTags. */ +public final class MobileNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkUpdateTags.json + */ + /** + * Sample code: Update mobile network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + MobileNetwork resource = + manager + .mobileNetworks() + .getByResourceGroupWithResponse("rg1", "testMobileNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/OperationList.json + */ + /** + * Sample code: Get Registration Operations. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getRegistrationOperations(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PacketCoreControlPlanes_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; +import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; + +/** Samples for PacketCoreControlPlanes CreateOrUpdate. */ +public final class PacketCoreControlPlanesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneCreate.json + */ + /** + * Sample code: Create packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createPacketCoreControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .packetCoreControlPlanes() + .define("TestPacketCoreCP") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withMobileNetwork( + new MobileNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork")) + .withControlPlaneAccessInterface(new InterfaceProperties().withName("N2")) + .withCustomLocation( + new CustomLocationResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/TestCustomLocation")) + .withCoreNetworkTechnology(CoreNetworkType.FIVE_GC) + .withVersion("0.2.0") + .create(); + } +} +``` + +### PacketCoreControlPlanes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes Delete. */ +public final class PacketCoreControlPlanesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneDelete.json + */ + /** + * Sample code: Delete packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deletePacketCoreControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().delete("rg1", "TestPacketCoreCP", Context.NONE); + } +} +``` + +### PacketCoreControlPlanes_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes GetByResourceGroup. */ +public final class PacketCoreControlPlanesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneGet.json + */ + /** + * Sample code: Get packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getPacketCoreControlPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().getByResourceGroupWithResponse("rg1", "TestPacketCoreCP", Context.NONE); + } +} +``` + +### PacketCoreControlPlanes_List + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes List. */ +public final class PacketCoreControlPlanesListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListBySubscription.json + */ + /** + * Sample code: List packet core control planes in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreControlPlanesInASubscription( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().list(Context.NONE); + } +} +``` + +### PacketCoreControlPlanes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes ListByResourceGroup. */ +public final class PacketCoreControlPlanesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json + */ + /** + * Sample code: List packet core control planes in resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreControlPlanesInResourceGroup( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### PacketCoreControlPlanes_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PacketCoreControlPlanes UpdateTags. */ +public final class PacketCoreControlPlanesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneUpdateTags.json + */ + /** + * Sample code: Update packet core control plane tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updatePacketCoreControlPlaneTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + PacketCoreControlPlane resource = + manager + .packetCoreControlPlanes() + .getByResourceGroupWithResponse("rg1", "TestPacketCoreCP", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### PacketCoreDataPlanes_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; + +/** Samples for PacketCoreDataPlanes CreateOrUpdate. */ +public final class PacketCoreDataPlanesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneCreate.json + */ + /** + * Sample code: Create packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createPacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .packetCoreDataPlanes() + .define("testPacketCoreDP") + .withRegion("eastus") + .withExistingPacketCoreControlPlane("rg1", "testPacketCoreCP") + .withUserPlaneAccessInterface(new InterfaceProperties().withName("N3")) + .create(); + } +} +``` + +### PacketCoreDataPlanes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes Delete. */ +public final class PacketCoreDataPlanesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneDelete.json + */ + /** + * Sample code: Delete packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deletePacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().delete("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE); + } +} +``` + +### PacketCoreDataPlanes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes Get. */ +public final class PacketCoreDataPlanesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneGet.json + */ + /** + * Sample code: Get packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getPacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().getWithResponse("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE); + } +} +``` + +### PacketCoreDataPlanes_ListByPacketCoreControlPlane + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes ListByPacketCoreControlPlane. */ +public final class PacketCoreDataPlanesListByPacketCoreControlPlaneSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json + */ + /** + * Sample code: List packet core data planes in a control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreDataPlanesInAControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().listByPacketCoreControlPlane("rg1", "testPacketCoreCP", Context.NONE); + } +} +``` + +### PacketCoreDataPlanes_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PacketCoreDataPlanes UpdateTags. */ +public final class PacketCoreDataPlanesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneUpdateTags.json + */ + /** + * Sample code: Update packet core data plane tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updatePacketCoreDataPlaneTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + PacketCoreDataPlane resource = + manager + .packetCoreDataPlanes() + .getWithResponse("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### Services_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; +import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; +import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; +import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; +import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; +import java.util.Arrays; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceCreate.json + */ + /** + * Sample code: Create service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .services() + .define("TestService") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withServicePrecedence(255) + .withPccRules( + Arrays + .asList( + new PccRuleConfiguration() + .withRuleName("default-rule") + .withRulePrecedence(255) + .withRuleQosPolicy( + new PccRuleQosPolicy() + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withMaximumBitRate(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps"))) + .withTrafficControl(TrafficControlPermission.ENABLED) + .withServiceDataFlowTemplates( + Arrays + .asList( + new ServiceDataFlowTemplate() + .withTemplateName("IP-to-server") + .withDirection(SdfDirection.UPLINK) + .withProtocol(Arrays.asList("ip")) + .withRemoteIpList(Arrays.asList("10.3.4.0/24")) + .withPorts(Arrays.asList()))))) + .withServiceQosPolicy( + new QosPolicy() + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withMaximumBitRate(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps"))) + .create(); + } +} +``` + +### Services_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceDelete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().delete("rg1", "testMobileNetwork", "TestService", Context.NONE); + } +} +``` + +### Services_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceGet.json + */ + /** + * Sample code: Get service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().getWithResponse("rg1", "testMobileNetwork", "TestService", Context.NONE); + } +} +``` + +### Services_ListByMobileNetwork + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListByMobileNetwork. */ +public final class ServicesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceListByMobileNetwork.json + */ + /** + * Sample code: List services in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listServicesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().listByMobileNetwork("testResourceGroupName", "testMobileNetwork", Context.NONE); + } +} +``` + +### Services_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Service; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services UpdateTags. */ +public final class ServicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceUpdateTags.json + */ + /** + * Sample code: Update service tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateServiceTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Service resource = + manager.services().getWithResponse("rg1", "testMobileNetwork", "TestService", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### SimPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; +import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import java.util.Arrays; + +/** Samples for SimPolicies CreateOrUpdate. */ +public final class SimPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyCreate.json + */ + /** + * Sample code: Create sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .simPolicies() + .define("testPolicy") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withUeAmbr(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps")) + .withDefaultSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withSliceConfigurations( + Arrays + .asList( + new SliceConfiguration() + .withSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withDefaultDataNetwork( + new DataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/dataNetworks/testdataNetwork")) + .withDataNetworkConfigurations( + Arrays + .asList( + new DataNetworkConfiguration() + .withDataNetwork( + new DataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/dataNetworks/testdataNetwork")) + .withSessionAmbr(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps")) + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withDefaultSessionType(PduSessionType.IPV4) + .withAdditionalAllowedSessionTypes(Arrays.asList()) + .withAllowedServices( + Arrays + .asList( + new ServiceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/services/testService"))))))) + .withRegistrationTimer(3240) + .create(); + } +} +``` + +### SimPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SimPolicies Delete. */ +public final class SimPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyDelete.json + */ + /** + * Sample code: Delete sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().delete("rg1", "testMobileNetwork", "testPolicy", Context.NONE); + } +} +``` + +### SimPolicies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SimPolicies Get. */ +public final class SimPoliciesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyGet.json + */ + /** + * Sample code: Get sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().getWithResponse("rg1", "testMobileNetwork", "testPolicy", Context.NONE); + } +} +``` + +### SimPolicies_ListByMobileNetwork + +```java +import com.azure.core.util.Context; + +/** Samples for SimPolicies ListByMobileNetwork. */ +public final class SimPoliciesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyListByMobileNetwork.json + */ + /** + * Sample code: List sim policies in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimPoliciesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().listByMobileNetwork("testResourceGroupName", "testMobileNetwork", Context.NONE); + } +} +``` + +### SimPolicies_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SimPolicies UpdateTags. */ +public final class SimPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyUpdateTags.json + */ + /** + * Sample code: Update sim policy tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateSimPolicyTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + SimPolicy resource = + manager.simPolicies().getWithResponse("rg1", "testMobileNetwork", "testPolicy", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### Sims_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpPropertiesStaticIp; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import java.util.Arrays; + +/** Samples for Sims CreateOrUpdate. */ +public final class SimsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimCreate.json + */ + /** + * Sample code: Create sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .sims() + .define("testSim") + .withRegion("testLocation") + .withExistingResourceGroup("rg1") + .withInternationalMobileSubscriberIdentity("00000") + .withIntegratedCircuitCardIdentifier("8900000000000000000") + .withAuthenticationKey("00000000000000000000000000000000") + .withOperatorKeyCode("00000000000000000000000000000000") + .withMobileNetwork( + new MobileNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork")) + .withDeviceType("Video camera") + .withSimPolicy( + new SimPolicyResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/simPolicies/MySimPolicy")) + .withStaticIpConfiguration( + Arrays + .asList( + new SimStaticIpProperties() + .withAttachedDataNetwork( + new AttachedDataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/TestPacketCoreCP/packetCoreDataPlanes/TestPacketCoreDP/attachedDataNetworks/TestAttachedDataNetwork")) + .withSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withStaticIp(new SimStaticIpPropertiesStaticIp().withIpv4Address("2.4.0.1")))) + .create(); + } +} +``` + +### Sims_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Sims Delete. */ +public final class SimsDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimDelete.json + */ + /** + * Sample code: Delete sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().delete("testResourceGroupName", "testSim", Context.NONE); + } +} +``` + +### Sims_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Sims GetByResourceGroup. */ +public final class SimsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimGet.json + */ + /** + * Sample code: Get sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().getByResourceGroupWithResponse("testResourceGroupName", "testSimName", Context.NONE); + } +} +``` + +### Sims_List + +```java +import com.azure.core.util.Context; + +/** Samples for Sims List. */ +public final class SimsListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListBySubscription.json + */ + /** + * Sample code: List sims in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimsInASubscription(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().list(Context.NONE); + } +} +``` + +### Sims_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Sims ListByResourceGroup. */ +public final class SimsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListByResourceGroup.json + */ + /** + * Sample code: List sims in a resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimsInAResourceGroup(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### Sims_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Sim; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sims UpdateTags. */ +public final class SimsUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimUpdateTags.json + */ + /** + * Sample code: Update sim tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateSimTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Sim resource = manager.sims().getByResourceGroupWithResponse("rg1", "testSim", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### Sites_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import java.util.Arrays; + +/** Samples for Sites CreateOrUpdate. */ +public final class SitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteCreate.json + */ + /** + * Sample code: Create mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .sites() + .define("testSite") + .withRegion("testLocation") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withNetworkFunctions( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/testNf"))) + .create(); + } +} +``` + +### Sites_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Sites Delete. */ +public final class SitesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteDelete.json + */ + /** + * Sample code: Delete mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().delete("rg1", "testMobileNetwork", "testSite", Context.NONE); + } +} +``` + +### Sites_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Sites Get. */ +public final class SitesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteGet.json + */ + /** + * Sample code: Get mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().getWithResponse("rg1", "testMobileNetwork", "testSite", Context.NONE); + } +} +``` + +### Sites_ListByMobileNetwork + +```java +import com.azure.core.util.Context; + +/** Samples for Sites ListByMobileNetwork. */ +public final class SitesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteListByMobileNetwork.json + */ + /** + * Sample code: List mobile network sites in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkSitesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} +``` + +### Sites_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Site; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sites UpdateTags. */ +public final class SitesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteUpdateTags.json + */ + /** + * Sample code: Update mobile network site tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkSiteTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Site resource = + manager.sites().getWithResponse("rg1", "testMobileNetwork", "testSite", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### Slices_CreateOrUpdate + +```java +import com.azure.resourcemanager.mobilenetwork.models.Snssai; + +/** Samples for Slices CreateOrUpdate. */ +public final class SlicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceCreate.json + */ + /** + * Sample code: Create mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .slices() + .define("testSlice") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withSnssai(new Snssai().withSst(1).withSd("1abcde")) + .withDescription("myFavouriteSlice") + .create(); + } +} +``` + +### Slices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Slices Delete. */ +public final class SlicesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceDelete.json + */ + /** + * Sample code: Delete mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().delete("rg1", "testMobileNetwork", "testSlice", Context.NONE); + } +} +``` + +### Slices_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Slices Get. */ +public final class SlicesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceGet.json + */ + /** + * Sample code: Get mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().getWithResponse("rg1", "testMobileNetwork", "testSlice", Context.NONE); + } +} +``` + +### Slices_ListByMobileNetwork + +```java +import com.azure.core.util.Context; + +/** Samples for Slices ListByMobileNetwork. */ +public final class SlicesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceListByMobileNetwork.json + */ + /** + * Sample code: List mobile network slices in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkSlicesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} +``` + +### Slices_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Slice; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Slices UpdateTags. */ +public final class SlicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceUpdateTags.json + */ + /** + * Sample code: Update mobile network slice tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkSliceTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Slice resource = + manager.slices().getWithResponse("rg1", "testMobileNetwork", "testSlice", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml new file mode 100644 index 000000000000..376d7719d4e9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-mobilenetwork + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for MobileNetwork Management + This package contains Microsoft Azure SDK for MobileNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The resources in this swagger specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance. Package tag package-2022-01-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + + diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java new file mode 100644 index 000000000000..ac92671ac18d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.MobileNetworkManagementClient; +import com.azure.resourcemanager.mobilenetwork.implementation.AttachedDataNetworksImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.DataNetworksImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.MobileNetworkManagementClientBuilder; +import com.azure.resourcemanager.mobilenetwork.implementation.MobileNetworksImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.OperationsImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.PacketCoreControlPlanesImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.PacketCoreDataPlanesImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.ServicesImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.SimPoliciesImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.SimsImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.SitesImpl; +import com.azure.resourcemanager.mobilenetwork.implementation.SlicesImpl; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworks; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworks; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworks; +import com.azure.resourcemanager.mobilenetwork.models.Operations; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlanes; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlanes; +import com.azure.resourcemanager.mobilenetwork.models.Services; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicies; +import com.azure.resourcemanager.mobilenetwork.models.Sims; +import com.azure.resourcemanager.mobilenetwork.models.Sites; +import com.azure.resourcemanager.mobilenetwork.models.Slices; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to MobileNetworkManager. The resources in this swagger specification will be used to manage attached data + * network resources in mobile network attached to a particular packet core instance. + */ +public final class MobileNetworkManager { + private AttachedDataNetworks attachedDataNetworks; + + private DataNetworks dataNetworks; + + private MobileNetworks mobileNetworks; + + private Sites sites; + + private Sims sims; + + private Operations operations; + + private PacketCoreControlPlanes packetCoreControlPlanes; + + private PacketCoreDataPlanes packetCoreDataPlanes; + + private Services services; + + private SimPolicies simPolicies; + + private Slices slices; + + private final MobileNetworkManagementClient clientObject; + + private MobileNetworkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new MobileNetworkManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of MobileNetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the MobileNetwork service API instance. + */ + public static MobileNetworkManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create MobileNetworkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new MobileNetworkManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of MobileNetwork service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the MobileNetwork service API instance. + */ + public MobileNetworkManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.mobilenetwork") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new MobileNetworkManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of AttachedDataNetworks. */ + public AttachedDataNetworks attachedDataNetworks() { + if (this.attachedDataNetworks == null) { + this.attachedDataNetworks = new AttachedDataNetworksImpl(clientObject.getAttachedDataNetworks(), this); + } + return attachedDataNetworks; + } + + /** @return Resource collection API of DataNetworks. */ + public DataNetworks dataNetworks() { + if (this.dataNetworks == null) { + this.dataNetworks = new DataNetworksImpl(clientObject.getDataNetworks(), this); + } + return dataNetworks; + } + + /** @return Resource collection API of MobileNetworks. */ + public MobileNetworks mobileNetworks() { + if (this.mobileNetworks == null) { + this.mobileNetworks = new MobileNetworksImpl(clientObject.getMobileNetworks(), this); + } + return mobileNetworks; + } + + /** @return Resource collection API of Sites. */ + public Sites sites() { + if (this.sites == null) { + this.sites = new SitesImpl(clientObject.getSites(), this); + } + return sites; + } + + /** @return Resource collection API of Sims. */ + public Sims sims() { + if (this.sims == null) { + this.sims = new SimsImpl(clientObject.getSims(), this); + } + return sims; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of PacketCoreControlPlanes. */ + public PacketCoreControlPlanes packetCoreControlPlanes() { + if (this.packetCoreControlPlanes == null) { + this.packetCoreControlPlanes = + new PacketCoreControlPlanesImpl(clientObject.getPacketCoreControlPlanes(), this); + } + return packetCoreControlPlanes; + } + + /** @return Resource collection API of PacketCoreDataPlanes. */ + public PacketCoreDataPlanes packetCoreDataPlanes() { + if (this.packetCoreDataPlanes == null) { + this.packetCoreDataPlanes = new PacketCoreDataPlanesImpl(clientObject.getPacketCoreDataPlanes(), this); + } + return packetCoreDataPlanes; + } + + /** @return Resource collection API of Services. */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** @return Resource collection API of SimPolicies. */ + public SimPolicies simPolicies() { + if (this.simPolicies == null) { + this.simPolicies = new SimPoliciesImpl(clientObject.getSimPolicies(), this); + } + return simPolicies; + } + + /** @return Resource collection API of Slices. */ + public Slices slices() { + if (this.slices == null) { + this.slices = new SlicesImpl(clientObject.getSlices(), this); + } + return slices; + } + + /** + * @return Wrapped service client MobileNetworkManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public MobileNetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/AttachedDataNetworksClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/AttachedDataNetworksClient.java new file mode 100644 index 000000000000..b08c538d6d73 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/AttachedDataNetworksClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in AttachedDataNetworksClient. */ +public interface AttachedDataNetworksClient { + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName); + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context); + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName); + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context); + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDataNetworkInner get( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName); + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context); + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AttachedDataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters); + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AttachedDataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context); + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDataNetworkInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters); + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDataNetworkInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context); + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDataNetworkInner updateTags( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters); + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters, + Context context); + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/DataNetworksClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/DataNetworksClient.java new file mode 100644 index 000000000000..39f1b7b4a320 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/DataNetworksClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in DataNetworksClient. */ +public interface DataNetworksClient { + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String dataNetworkName); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataNetworkInner get(String resourceGroupName, String mobileNetworkName, String dataNetworkName); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context); + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters); + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context); + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters); + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataNetworkInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context); + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataNetworkInner updateTags( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters); + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + TagsObject parameters, + Context context); + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworkManagementClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworkManagementClient.java new file mode 100644 index 000000000000..14ba0ecd5fc7 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworkManagementClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for MobileNetworkManagementClient class. */ +public interface MobileNetworkManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AttachedDataNetworksClient object to access its operations. + * + * @return the AttachedDataNetworksClient object. + */ + AttachedDataNetworksClient getAttachedDataNetworks(); + + /** + * Gets the DataNetworksClient object to access its operations. + * + * @return the DataNetworksClient object. + */ + DataNetworksClient getDataNetworks(); + + /** + * Gets the MobileNetworksClient object to access its operations. + * + * @return the MobileNetworksClient object. + */ + MobileNetworksClient getMobileNetworks(); + + /** + * Gets the SitesClient object to access its operations. + * + * @return the SitesClient object. + */ + SitesClient getSites(); + + /** + * Gets the SimsClient object to access its operations. + * + * @return the SimsClient object. + */ + SimsClient getSims(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PacketCoreControlPlanesClient object to access its operations. + * + * @return the PacketCoreControlPlanesClient object. + */ + PacketCoreControlPlanesClient getPacketCoreControlPlanes(); + + /** + * Gets the PacketCoreDataPlanesClient object to access its operations. + * + * @return the PacketCoreDataPlanesClient object. + */ + PacketCoreDataPlanesClient getPacketCoreDataPlanes(); + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + ServicesClient getServices(); + + /** + * Gets the SimPoliciesClient object to access its operations. + * + * @return the SimPoliciesClient object. + */ + SimPoliciesClient getSimPolicies(); + + /** + * Gets the SlicesClient object to access its operations. + * + * @return the SlicesClient object. + */ + SlicesClient getSlices(); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworksClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworksClient.java new file mode 100644 index 000000000000..97fd6dd1bdff --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/MobileNetworksClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in MobileNetworksClient. */ +public interface MobileNetworksClient { + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String mobileNetworkName); + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName); + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MobileNetworkInner getByResourceGroup(String resourceGroupName, String mobileNetworkName); + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MobileNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters); + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MobileNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context); + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MobileNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters); + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MobileNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context); + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MobileNetworkInner updateTags(String resourceGroupName, String mobileNetworkName, TagsObject parameters); + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, TagsObject parameters, Context context); + + /** + * Lists all the mobile networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the mobile networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimIdListResultInner> beginListSimIds( + String resourceGroupName, String mobileNetworkName); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimIdListResultInner> beginListSimIds( + String resourceGroupName, String mobileNetworkName, Context context); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimIdListResultInner listSimIds(String resourceGroupName, String mobileNetworkName); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimIdListResultInner listSimIds(String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/OperationsClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/OperationsClient.java new file mode 100644 index 000000000000..1178375ea3c2 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of the operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreControlPlanesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreControlPlanesClient.java new file mode 100644 index 000000000000..371f24168cd6 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreControlPlanesClient.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PacketCoreControlPlanesClient. */ +public interface PacketCoreControlPlanesClient { + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreControlPlaneInner getByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PacketCoreControlPlaneInner> beginCreateOrUpdate( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters); + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PacketCoreControlPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context); + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreControlPlaneInner createOrUpdate( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters); + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreControlPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context); + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreControlPlaneInner updateTags( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters); + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters, Context context); + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreDataPlanesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreDataPlanesClient.java new file mode 100644 index 000000000000..496d9bc0ffbd --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/PacketCoreDataPlanesClient.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in PacketCoreDataPlanesClient. */ +public interface PacketCoreDataPlanesClient { + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreDataPlaneInner get( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PacketCoreDataPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters); + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PacketCoreDataPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context); + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreDataPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters); + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreDataPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context); + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCoreDataPlaneInner updateTags( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters); + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters, + Context context); + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/ServicesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/ServicesClient.java new file mode 100644 index 000000000000..25182b3c2a42 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/ServicesClient.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public interface ServicesClient { + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String serviceName); + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context); + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String serviceName); + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String serviceName, Context context); + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceInner get(String resourceGroupName, String mobileNetworkName, String serviceName); + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context); + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters); + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context); + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters); + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context); + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceInner updateTags( + String resourceGroupName, String mobileNetworkName, String serviceName, TagsObject parameters); + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, String serviceName, TagsObject parameters, Context context); + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimPoliciesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimPoliciesClient.java new file mode 100644 index 000000000000..5f6603ebb7bb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimPoliciesClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SimPoliciesClient. */ +public interface SimPoliciesClient { + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String simPolicyName); + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context); + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName); + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context); + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimPolicyInner get(String resourceGroupName, String mobileNetworkName, String simPolicyName); + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context); + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters); + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context); + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimPolicyInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters); + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimPolicyInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context); + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimPolicyInner updateTags( + String resourceGroupName, String mobileNetworkName, String simPolicyName, TagsObject parameters); + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + TagsObject parameters, + Context context); + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimsClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimsClient.java new file mode 100644 index 000000000000..29f27360460d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SimsClient.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SimsClient. */ +public interface SimsClient { + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String simName); + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String simName, Context context); + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String simName); + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String simName, Context context); + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimInner getByResourceGroup(String resourceGroupName, String simName); + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String simName, Context context); + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimInner> beginCreateOrUpdate( + String resourceGroupName, String simName, SimInner parameters); + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SimInner> beginCreateOrUpdate( + String resourceGroupName, String simName, SimInner parameters, Context context); + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimInner createOrUpdate(String resourceGroupName, String simName, SimInner parameters); + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimInner createOrUpdate(String resourceGroupName, String simName, SimInner parameters, Context context); + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SimInner updateTags(String resourceGroupName, String simName, TagsObject parameters); + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String simName, TagsObject parameters, Context context); + + /** + * Gets all the sims in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the sims in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SitesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SitesClient.java new file mode 100644 index 000000000000..abc2f3fbedc1 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SitesClient.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SitesClient. */ +public interface SitesClient { + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String mobileNetworkName, String siteName); + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String siteName, Context context); + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String siteName); + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String siteName, Context context); + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteInner get(String resourceGroupName, String mobileNetworkName, String siteName); + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, Context context); + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters); + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context); + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteInner createOrUpdate(String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters); + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context); + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SiteInner updateTags(String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters); + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters, Context context); + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SlicesClient.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SlicesClient.java new file mode 100644 index 000000000000..5f58299b8986 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/SlicesClient.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SlicesClient. */ +public interface SlicesClient { + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String sliceName); + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context); + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String sliceName); + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String mobileNetworkName, String sliceName, Context context); + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SliceInner get(String resourceGroupName, String mobileNetworkName, String sliceName); + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context); + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SliceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters); + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SliceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context); + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SliceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters); + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SliceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context); + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SliceInner updateTags(String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters); + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters, Context context); + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkInner.java new file mode 100644 index 000000000000..899667f47aca --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkInner.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Attached data network resource. */ +@Fluent +public final class AttachedDataNetworkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDataNetworkInner.class); + + /* + * Data network properties. + */ + @JsonProperty(value = "properties", required = true) + private AttachedDataNetworkPropertiesFormat innerProperties = new AttachedDataNetworkPropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Data network properties. + * + * @return the innerProperties value. + */ + private AttachedDataNetworkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public AttachedDataNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AttachedDataNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the attached data network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the userPlaneDataInterface property: The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi interface. + * + * @return the userPlaneDataInterface value. + */ + public InterfaceProperties userPlaneDataInterface() { + return this.innerProperties() == null ? null : this.innerProperties().userPlaneDataInterface(); + } + + /** + * Set the userPlaneDataInterface property: The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi interface. + * + * @param userPlaneDataInterface the userPlaneDataInterface value to set. + * @return the AttachedDataNetworkInner object itself. + */ + public AttachedDataNetworkInner withUserPlaneDataInterface(InterfaceProperties userPlaneDataInterface) { + if (this.innerProperties() == null) { + this.innerProperties = new AttachedDataNetworkPropertiesFormat(); + } + this.innerProperties().withUserPlaneDataInterface(userPlaneDataInterface); + return this; + } + + /** + * Get the naptConfiguration property: The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * + * @return the naptConfiguration value. + */ + public NaptConfiguration naptConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().naptConfiguration(); + } + + /** + * Set the naptConfiguration property: The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * + * @param naptConfiguration the naptConfiguration value to set. + * @return the AttachedDataNetworkInner object itself. + */ + public AttachedDataNetworkInner withNaptConfiguration(NaptConfiguration naptConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new AttachedDataNetworkPropertiesFormat(); + } + this.innerProperties().withNaptConfiguration(naptConfiguration); + return this; + } + + /** + * Get the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentAddressPoolPrefix value. + */ + public List userEquipmentAddressPoolPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().userEquipmentAddressPoolPrefix(); + } + + /** + * Set the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @param userEquipmentAddressPoolPrefix the userEquipmentAddressPoolPrefix value to set. + * @return the AttachedDataNetworkInner object itself. + */ + public AttachedDataNetworkInner withUserEquipmentAddressPoolPrefix(List userEquipmentAddressPoolPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new AttachedDataNetworkPropertiesFormat(); + } + this.innerProperties().withUserEquipmentAddressPoolPrefix(userEquipmentAddressPoolPrefix); + return this; + } + + /** + * Get the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The mapping of + * static IP to sim is configured in staticIpConfiguration on the sim resource. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentStaticAddressPoolPrefix value. + */ + public List userEquipmentStaticAddressPoolPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().userEquipmentStaticAddressPoolPrefix(); + } + + /** + * Set the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The mapping of + * static IP to sim is configured in staticIpConfiguration on the sim resource. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @param userEquipmentStaticAddressPoolPrefix the userEquipmentStaticAddressPoolPrefix value to set. + * @return the AttachedDataNetworkInner object itself. + */ + public AttachedDataNetworkInner withUserEquipmentStaticAddressPoolPrefix( + List userEquipmentStaticAddressPoolPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new AttachedDataNetworkPropertiesFormat(); + } + this.innerProperties().withUserEquipmentStaticAddressPoolPrefix(userEquipmentStaticAddressPoolPrefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model AttachedDataNetworkInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkPropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkPropertiesFormat.java new file mode 100644 index 000000000000..300a51d6555c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/AttachedDataNetworkPropertiesFormat.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data network properties. */ +@Fluent +public final class AttachedDataNetworkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDataNetworkPropertiesFormat.class); + + /* + * The provisioning state of the attached data network resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi + * interface. + */ + @JsonProperty(value = "userPlaneDataInterface", required = true) + private InterfaceProperties userPlaneDataInterface; + + /* + * The Network Address and Port Translation configuration. + * If not specified the attached data network uses a default NAPT + * configuration with NAPT enabled. + */ + @JsonProperty(value = "naptConfiguration") + private NaptConfiguration naptConfiguration; + + /* + * The user equipment address pool prefixes for the attached data network + * that are dynamically assigned by the core to UEs when they set up a PDU + * session. + * At least one of userEquipmentAddressPoolPrefix and + * userEquipmentStaticAddressPoolPrefix must be defined. If both are + * defined then they must be the same size. + */ + @JsonProperty(value = "userEquipmentAddressPoolPrefix") + private List userEquipmentAddressPoolPrefix; + + /* + * The user equipment address pool prefixes for the attached data network + * that are statically assigned by the core to UEs when they set up a PDU + * session. + * The mapping of static IP to sim is configured in staticIpConfiguration + * on the sim resource. + * At least one of userEquipmentAddressPoolPrefix and + * userEquipmentStaticAddressPoolPrefix must be defined. If both are + * defined then they must be the same size. + */ + @JsonProperty(value = "userEquipmentStaticAddressPoolPrefix") + private List userEquipmentStaticAddressPoolPrefix; + + /** + * Get the provisioningState property: The provisioning state of the attached data network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the userPlaneDataInterface property: The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi interface. + * + * @return the userPlaneDataInterface value. + */ + public InterfaceProperties userPlaneDataInterface() { + return this.userPlaneDataInterface; + } + + /** + * Set the userPlaneDataInterface property: The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi interface. + * + * @param userPlaneDataInterface the userPlaneDataInterface value to set. + * @return the AttachedDataNetworkPropertiesFormat object itself. + */ + public AttachedDataNetworkPropertiesFormat withUserPlaneDataInterface(InterfaceProperties userPlaneDataInterface) { + this.userPlaneDataInterface = userPlaneDataInterface; + return this; + } + + /** + * Get the naptConfiguration property: The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * + * @return the naptConfiguration value. + */ + public NaptConfiguration naptConfiguration() { + return this.naptConfiguration; + } + + /** + * Set the naptConfiguration property: The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * + * @param naptConfiguration the naptConfiguration value to set. + * @return the AttachedDataNetworkPropertiesFormat object itself. + */ + public AttachedDataNetworkPropertiesFormat withNaptConfiguration(NaptConfiguration naptConfiguration) { + this.naptConfiguration = naptConfiguration; + return this; + } + + /** + * Get the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentAddressPoolPrefix value. + */ + public List userEquipmentAddressPoolPrefix() { + return this.userEquipmentAddressPoolPrefix; + } + + /** + * Set the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @param userEquipmentAddressPoolPrefix the userEquipmentAddressPoolPrefix value to set. + * @return the AttachedDataNetworkPropertiesFormat object itself. + */ + public AttachedDataNetworkPropertiesFormat withUserEquipmentAddressPoolPrefix( + List userEquipmentAddressPoolPrefix) { + this.userEquipmentAddressPoolPrefix = userEquipmentAddressPoolPrefix; + return this; + } + + /** + * Get the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The mapping of + * static IP to sim is configured in staticIpConfiguration on the sim resource. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentStaticAddressPoolPrefix value. + */ + public List userEquipmentStaticAddressPoolPrefix() { + return this.userEquipmentStaticAddressPoolPrefix; + } + + /** + * Set the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The mapping of + * static IP to sim is configured in staticIpConfiguration on the sim resource. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @param userEquipmentStaticAddressPoolPrefix the userEquipmentStaticAddressPoolPrefix value to set. + * @return the AttachedDataNetworkPropertiesFormat object itself. + */ + public AttachedDataNetworkPropertiesFormat withUserEquipmentStaticAddressPoolPrefix( + List userEquipmentStaticAddressPoolPrefix) { + this.userEquipmentStaticAddressPoolPrefix = userEquipmentStaticAddressPoolPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userPlaneDataInterface() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property userPlaneDataInterface in model" + + " AttachedDataNetworkPropertiesFormat")); + } else { + userPlaneDataInterface().validate(); + } + if (naptConfiguration() != null) { + naptConfiguration().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkInner.java new file mode 100644 index 000000000000..36dee2b3e7b3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Data network resource. */ +@Fluent +public final class DataNetworkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworkInner.class); + + /* + * Data network properties. + */ + @JsonProperty(value = "properties") + private DataNetworkPropertiesFormat innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Data network properties. + * + * @return the innerProperties value. + */ + private DataNetworkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public DataNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the data network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the description property: An optional description for this data network. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: An optional description for this data network. + * + * @param description the description value to set. + * @return the DataNetworkInner object itself. + */ + public DataNetworkInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new DataNetworkPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkPropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkPropertiesFormat.java new file mode 100644 index 000000000000..cb6b8484a164 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/DataNetworkPropertiesFormat.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data network properties. */ +@Fluent +public final class DataNetworkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworkPropertiesFormat.class); + + /* + * The provisioning state of the data network resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * An optional description for this data network. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provisioningState property: The provisioning state of the data network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the description property: An optional description for this data network. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: An optional description for this data network. + * + * @param description the description value to set. + * @return the DataNetworkPropertiesFormat object itself. + */ + public DataNetworkPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkInner.java new file mode 100644 index 000000000000..dbcbbb7ef139 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.PlmnId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Mobile network resource. */ +@Fluent +public final class MobileNetworkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobileNetworkInner.class); + + /* + * Mobile network properties. + */ + @JsonProperty(value = "properties", required = true) + private MobileNetworkPropertiesFormat innerProperties = new MobileNetworkPropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Mobile network properties. + * + * @return the innerProperties value. + */ + private MobileNetworkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public MobileNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MobileNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the mobile network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publicLandMobileNetworkIdentifier property: The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 + * and 999-999 can be used on internal private networks. + * + * @return the publicLandMobileNetworkIdentifier value. + */ + public PlmnId publicLandMobileNetworkIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().publicLandMobileNetworkIdentifier(); + } + + /** + * Set the publicLandMobileNetworkIdentifier property: The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 + * and 999-999 can be used on internal private networks. + * + * @param publicLandMobileNetworkIdentifier the publicLandMobileNetworkIdentifier value to set. + * @return the MobileNetworkInner object itself. + */ + public MobileNetworkInner withPublicLandMobileNetworkIdentifier(PlmnId publicLandMobileNetworkIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new MobileNetworkPropertiesFormat(); + } + this.innerProperties().withPublicLandMobileNetworkIdentifier(publicLandMobileNetworkIdentifier); + return this; + } + + /** + * Get the serviceKey property: The mobile network resource identifier. + * + * @return the serviceKey value. + */ + public String serviceKey() { + return this.innerProperties() == null ? null : this.innerProperties().serviceKey(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model MobileNetworkInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkPropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkPropertiesFormat.java new file mode 100644 index 000000000000..cf9735dc7282 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/MobileNetworkPropertiesFormat.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.PlmnId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Mobile network properties. */ +@Fluent +public final class MobileNetworkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobileNetworkPropertiesFormat.class); + + /* + * The provisioning state of the mobile network resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The unique public land mobile network identifier for the network. This + * is made up of the Mobile Country Code and Mobile Network Code, as + * defined in https://www.itu.int/rec/T-REC-E.212. The values 001-01 and + * 001-001 can be used for testing and the values 999-99 and 999-999 can be + * used on internal private networks. + */ + @JsonProperty(value = "publicLandMobileNetworkIdentifier", required = true) + private PlmnId publicLandMobileNetworkIdentifier; + + /* + * The mobile network resource identifier + */ + @JsonProperty(value = "serviceKey", access = JsonProperty.Access.WRITE_ONLY) + private String serviceKey; + + /** + * Get the provisioningState property: The provisioning state of the mobile network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicLandMobileNetworkIdentifier property: The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 + * and 999-999 can be used on internal private networks. + * + * @return the publicLandMobileNetworkIdentifier value. + */ + public PlmnId publicLandMobileNetworkIdentifier() { + return this.publicLandMobileNetworkIdentifier; + } + + /** + * Set the publicLandMobileNetworkIdentifier property: The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 + * and 999-999 can be used on internal private networks. + * + * @param publicLandMobileNetworkIdentifier the publicLandMobileNetworkIdentifier value to set. + * @return the MobileNetworkPropertiesFormat object itself. + */ + public MobileNetworkPropertiesFormat withPublicLandMobileNetworkIdentifier( + PlmnId publicLandMobileNetworkIdentifier) { + this.publicLandMobileNetworkIdentifier = publicLandMobileNetworkIdentifier; + return this; + } + + /** + * Get the serviceKey property: The mobile network resource identifier. + * + * @return the serviceKey value. + */ + public String serviceKey() { + return this.serviceKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicLandMobileNetworkIdentifier() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicLandMobileNetworkIdentifier in model" + + " MobileNetworkPropertiesFormat")); + } else { + publicLandMobileNetworkIdentifier().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/OperationInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/OperationInner.java new file mode 100644 index 000000000000..feb28a701284 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/OperationInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object that describes a single Microsoft.MobileNetwork operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Indicates whether the operation applies to data-plane. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlaneInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlaneInner.java new file mode 100644 index 000000000000..2194a06dcbd1 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlaneInner.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; +import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Packet core control plane resource. */ +@Fluent +public final class PacketCoreControlPlaneInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreControlPlaneInner.class); + + /* + * Packet core control plane Properties. + */ + @JsonProperty(value = "properties", required = true) + private PacketCoreControlPlanePropertiesFormat innerProperties = new PacketCoreControlPlanePropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Packet core control plane Properties. + * + * @return the innerProperties value. + */ + private PacketCoreControlPlanePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public PacketCoreControlPlaneInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCoreControlPlaneInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the packet core control plane resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @return the mobileNetwork value. + */ + public MobileNetworkResourceId mobileNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().mobileNetwork(); + } + + /** + * Set the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @param mobileNetwork the mobileNetwork value to set. + * @return the PacketCoreControlPlaneInner object itself. + */ + public PacketCoreControlPlaneInner withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreControlPlanePropertiesFormat(); + } + this.innerProperties().withMobileNetwork(mobileNetwork); + return this; + } + + /** + * Get the customLocation property: Azure ARC custom location where the packet core is deployed. + * + * @return the customLocation value. + */ + public CustomLocationResourceId customLocation() { + return this.innerProperties() == null ? null : this.innerProperties().customLocation(); + } + + /** + * Set the customLocation property: Azure ARC custom location where the packet core is deployed. + * + * @param customLocation the customLocation value to set. + * @return the PacketCoreControlPlaneInner object itself. + */ + public PacketCoreControlPlaneInner withCustomLocation(CustomLocationResourceId customLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreControlPlanePropertiesFormat(); + } + this.innerProperties().withCustomLocation(customLocation); + return this; + } + + /** + * Get the coreNetworkTechnology property: The core network technology generation. + * + * @return the coreNetworkTechnology value. + */ + public CoreNetworkType coreNetworkTechnology() { + return this.innerProperties() == null ? null : this.innerProperties().coreNetworkTechnology(); + } + + /** + * Set the coreNetworkTechnology property: The core network technology generation. + * + * @param coreNetworkTechnology the coreNetworkTechnology value to set. + * @return the PacketCoreControlPlaneInner object itself. + */ + public PacketCoreControlPlaneInner withCoreNetworkTechnology(CoreNetworkType coreNetworkTechnology) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreControlPlanePropertiesFormat(); + } + this.innerProperties().withCoreNetworkTechnology(coreNetworkTechnology); + return this; + } + + /** + * Get the version property: The version of the packet core software that is deployed. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of the packet core software that is deployed. + * + * @param version the version value to set. + * @return the PacketCoreControlPlaneInner object itself. + */ + public PacketCoreControlPlaneInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreControlPlanePropertiesFormat(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the controlPlaneAccessInterface property: The control plane interface on the access network. In 5G networks + * this is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * + * @return the controlPlaneAccessInterface value. + */ + public InterfaceProperties controlPlaneAccessInterface() { + return this.innerProperties() == null ? null : this.innerProperties().controlPlaneAccessInterface(); + } + + /** + * Set the controlPlaneAccessInterface property: The control plane interface on the access network. In 5G networks + * this is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * + * @param controlPlaneAccessInterface the controlPlaneAccessInterface value to set. + * @return the PacketCoreControlPlaneInner object itself. + */ + public PacketCoreControlPlaneInner withControlPlaneAccessInterface( + InterfaceProperties controlPlaneAccessInterface) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreControlPlanePropertiesFormat(); + } + this.innerProperties().withControlPlaneAccessInterface(controlPlaneAccessInterface); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model PacketCoreControlPlaneInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlanePropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlanePropertiesFormat.java new file mode 100644 index 000000000000..2bf92c787d12 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreControlPlanePropertiesFormat.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; +import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PacketCoreControlPlane properties. */ +@Fluent +public final class PacketCoreControlPlanePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreControlPlanePropertiesFormat.class); + + /* + * The provisioning state of the packet core control plane resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Mobile network that this packet core control plane belongs to + */ + @JsonProperty(value = "mobileNetwork", required = true) + private MobileNetworkResourceId mobileNetwork; + + /* + * Azure ARC custom location where the packet core is deployed. + */ + @JsonProperty(value = "customLocation") + private CustomLocationResourceId customLocation; + + /* + * The core network technology generation. + */ + @JsonProperty(value = "coreNetworkTechnology") + private CoreNetworkType coreNetworkTechnology; + + /* + * The version of the packet core software that is deployed. + */ + @JsonProperty(value = "version") + private String version; + + /* + * The control plane interface on the access network. In 5G networks this + * is called as N2 interface whereas in 4G networks this is called as + * S1-MME interface. + */ + @JsonProperty(value = "controlPlaneAccessInterface", required = true) + private InterfaceProperties controlPlaneAccessInterface; + + /** + * Get the provisioningState property: The provisioning state of the packet core control plane resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @return the mobileNetwork value. + */ + public MobileNetworkResourceId mobileNetwork() { + return this.mobileNetwork; + } + + /** + * Set the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @param mobileNetwork the mobileNetwork value to set. + * @return the PacketCoreControlPlanePropertiesFormat object itself. + */ + public PacketCoreControlPlanePropertiesFormat withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + this.mobileNetwork = mobileNetwork; + return this; + } + + /** + * Get the customLocation property: Azure ARC custom location where the packet core is deployed. + * + * @return the customLocation value. + */ + public CustomLocationResourceId customLocation() { + return this.customLocation; + } + + /** + * Set the customLocation property: Azure ARC custom location where the packet core is deployed. + * + * @param customLocation the customLocation value to set. + * @return the PacketCoreControlPlanePropertiesFormat object itself. + */ + public PacketCoreControlPlanePropertiesFormat withCustomLocation(CustomLocationResourceId customLocation) { + this.customLocation = customLocation; + return this; + } + + /** + * Get the coreNetworkTechnology property: The core network technology generation. + * + * @return the coreNetworkTechnology value. + */ + public CoreNetworkType coreNetworkTechnology() { + return this.coreNetworkTechnology; + } + + /** + * Set the coreNetworkTechnology property: The core network technology generation. + * + * @param coreNetworkTechnology the coreNetworkTechnology value to set. + * @return the PacketCoreControlPlanePropertiesFormat object itself. + */ + public PacketCoreControlPlanePropertiesFormat withCoreNetworkTechnology(CoreNetworkType coreNetworkTechnology) { + this.coreNetworkTechnology = coreNetworkTechnology; + return this; + } + + /** + * Get the version property: The version of the packet core software that is deployed. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the packet core software that is deployed. + * + * @param version the version value to set. + * @return the PacketCoreControlPlanePropertiesFormat object itself. + */ + public PacketCoreControlPlanePropertiesFormat withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the controlPlaneAccessInterface property: The control plane interface on the access network. In 5G networks + * this is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * + * @return the controlPlaneAccessInterface value. + */ + public InterfaceProperties controlPlaneAccessInterface() { + return this.controlPlaneAccessInterface; + } + + /** + * Set the controlPlaneAccessInterface property: The control plane interface on the access network. In 5G networks + * this is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * + * @param controlPlaneAccessInterface the controlPlaneAccessInterface value to set. + * @return the PacketCoreControlPlanePropertiesFormat object itself. + */ + public PacketCoreControlPlanePropertiesFormat withControlPlaneAccessInterface( + InterfaceProperties controlPlaneAccessInterface) { + this.controlPlaneAccessInterface = controlPlaneAccessInterface; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mobileNetwork() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property mobileNetwork in model PacketCoreControlPlanePropertiesFormat")); + } else { + mobileNetwork().validate(); + } + if (customLocation() != null) { + customLocation().validate(); + } + if (controlPlaneAccessInterface() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property controlPlaneAccessInterface in model" + + " PacketCoreControlPlanePropertiesFormat")); + } else { + controlPlaneAccessInterface().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlaneInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlaneInner.java new file mode 100644 index 000000000000..2fa290135076 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlaneInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Packet core data plane resource. */ +@Fluent +public final class PacketCoreDataPlaneInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreDataPlaneInner.class); + + /* + * Packet core data plane Properties. + */ + @JsonProperty(value = "properties", required = true) + private PacketCoreDataPlanePropertiesFormat innerProperties = new PacketCoreDataPlanePropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Packet core data plane Properties. + * + * @return the innerProperties value. + */ + private PacketCoreDataPlanePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public PacketCoreDataPlaneInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCoreDataPlaneInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the packet core data plane resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the userPlaneAccessInterface property: The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U interface. + * + * @return the userPlaneAccessInterface value. + */ + public InterfaceProperties userPlaneAccessInterface() { + return this.innerProperties() == null ? null : this.innerProperties().userPlaneAccessInterface(); + } + + /** + * Set the userPlaneAccessInterface property: The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U interface. + * + * @param userPlaneAccessInterface the userPlaneAccessInterface value to set. + * @return the PacketCoreDataPlaneInner object itself. + */ + public PacketCoreDataPlaneInner withUserPlaneAccessInterface(InterfaceProperties userPlaneAccessInterface) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCoreDataPlanePropertiesFormat(); + } + this.innerProperties().withUserPlaneAccessInterface(userPlaneAccessInterface); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model PacketCoreDataPlaneInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlanePropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlanePropertiesFormat.java new file mode 100644 index 000000000000..687ccc33af00 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/PacketCoreDataPlanePropertiesFormat.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PacketCoreDataPlane properties. */ +@Fluent +public final class PacketCoreDataPlanePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreDataPlanePropertiesFormat.class); + + /* + * The provisioning state of the packet core data plane resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U + * interface. + */ + @JsonProperty(value = "userPlaneAccessInterface", required = true) + private InterfaceProperties userPlaneAccessInterface; + + /** + * Get the provisioningState property: The provisioning state of the packet core data plane resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the userPlaneAccessInterface property: The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U interface. + * + * @return the userPlaneAccessInterface value. + */ + public InterfaceProperties userPlaneAccessInterface() { + return this.userPlaneAccessInterface; + } + + /** + * Set the userPlaneAccessInterface property: The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U interface. + * + * @param userPlaneAccessInterface the userPlaneAccessInterface value to set. + * @return the PacketCoreDataPlanePropertiesFormat object itself. + */ + public PacketCoreDataPlanePropertiesFormat withUserPlaneAccessInterface( + InterfaceProperties userPlaneAccessInterface) { + this.userPlaneAccessInterface = userPlaneAccessInterface; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userPlaneAccessInterface() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property userPlaneAccessInterface in model" + + " PacketCoreDataPlanePropertiesFormat")); + } else { + userPlaneAccessInterface().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServiceInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServiceInner.java new file mode 100644 index 000000000000..c876cc348faa --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServiceInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service resource. */ +@Fluent +public final class ServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceInner.class); + + /* + * Service Properties. + */ + @JsonProperty(value = "properties", required = true) + private ServicePropertiesFormat innerProperties = new ServicePropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Service Properties. + * + * @return the innerProperties value. + */ + private ServicePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public ServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the servicePrecedence property: A precedence value that is used to decide between services when identifying + * the QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique + * among all services configured in the Mobile Network. + * + * @return the servicePrecedence value. + */ + public int servicePrecedence() { + return this.innerProperties() == null ? 0 : this.innerProperties().servicePrecedence(); + } + + /** + * Set the servicePrecedence property: A precedence value that is used to decide between services when identifying + * the QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique + * among all services configured in the Mobile Network. + * + * @param servicePrecedence the servicePrecedence value to set. + * @return the ServiceInner object itself. + */ + public ServiceInner withServicePrecedence(int servicePrecedence) { + if (this.innerProperties() == null) { + this.innerProperties = new ServicePropertiesFormat(); + } + this.innerProperties().withServicePrecedence(servicePrecedence); + return this; + } + + /** + * Get the serviceQosPolicy property: The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * + * @return the serviceQosPolicy value. + */ + public QosPolicy serviceQosPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().serviceQosPolicy(); + } + + /** + * Set the serviceQosPolicy property: The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * + * @param serviceQosPolicy the serviceQosPolicy value to set. + * @return the ServiceInner object itself. + */ + public ServiceInner withServiceQosPolicy(QosPolicy serviceQosPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ServicePropertiesFormat(); + } + this.innerProperties().withServiceQosPolicy(serviceQosPolicy); + return this; + } + + /** + * Get the pccRules property: The set of PCC Rules that make up this service. + * + * @return the pccRules value. + */ + public List pccRules() { + return this.innerProperties() == null ? null : this.innerProperties().pccRules(); + } + + /** + * Set the pccRules property: The set of PCC Rules that make up this service. + * + * @param pccRules the pccRules value to set. + * @return the ServiceInner object itself. + */ + public ServiceInner withPccRules(List pccRules) { + if (this.innerProperties() == null) { + this.innerProperties = new ServicePropertiesFormat(); + } + this.innerProperties().withPccRules(pccRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ServiceInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServicePropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServicePropertiesFormat.java new file mode 100644 index 000000000000..d74a906b90df --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/ServicePropertiesFormat.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service properties. */ +@Fluent +public final class ServicePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicePropertiesFormat.class); + + /* + * The provisioning state of the service resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * A precedence value that is used to decide between services when + * identifying the QoS values to use for a particular Sim. A lower value + * means a higher priority. This value should be unique among all services + * configured in the Mobile Network. + */ + @JsonProperty(value = "servicePrecedence", required = true) + private int servicePrecedence; + + /* + * The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a + * PccRuleConfiguration. If this field is null then the UE's simPolicy will + * define the QoS settings. + */ + @JsonProperty(value = "serviceQosPolicy") + private QosPolicy serviceQosPolicy; + + /* + * The set of PCC Rules that make up this service. + */ + @JsonProperty(value = "pccRules", required = true) + private List pccRules; + + /** + * Get the provisioningState property: The provisioning state of the service resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the servicePrecedence property: A precedence value that is used to decide between services when identifying + * the QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique + * among all services configured in the Mobile Network. + * + * @return the servicePrecedence value. + */ + public int servicePrecedence() { + return this.servicePrecedence; + } + + /** + * Set the servicePrecedence property: A precedence value that is used to decide between services when identifying + * the QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique + * among all services configured in the Mobile Network. + * + * @param servicePrecedence the servicePrecedence value to set. + * @return the ServicePropertiesFormat object itself. + */ + public ServicePropertiesFormat withServicePrecedence(int servicePrecedence) { + this.servicePrecedence = servicePrecedence; + return this; + } + + /** + * Get the serviceQosPolicy property: The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * + * @return the serviceQosPolicy value. + */ + public QosPolicy serviceQosPolicy() { + return this.serviceQosPolicy; + } + + /** + * Set the serviceQosPolicy property: The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * + * @param serviceQosPolicy the serviceQosPolicy value to set. + * @return the ServicePropertiesFormat object itself. + */ + public ServicePropertiesFormat withServiceQosPolicy(QosPolicy serviceQosPolicy) { + this.serviceQosPolicy = serviceQosPolicy; + return this; + } + + /** + * Get the pccRules property: The set of PCC Rules that make up this service. + * + * @return the pccRules value. + */ + public List pccRules() { + return this.pccRules; + } + + /** + * Set the pccRules property: The set of PCC Rules that make up this service. + * + * @param pccRules the pccRules value to set. + * @return the ServicePropertiesFormat object itself. + */ + public ServicePropertiesFormat withPccRules(List pccRules) { + this.pccRules = pccRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceQosPolicy() != null) { + serviceQosPolicy().validate(); + } + if (pccRules() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pccRules in model ServicePropertiesFormat")); + } else { + pccRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimIdListResultInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimIdListResultInner.java new file mode 100644 index 000000000000..b024976bea45 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimIdListResultInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list sim ids API service call. */ +@Fluent +public final class SimIdListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimIdListResultInner.class); + + /* + * A list of sim profile ids in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of sim profile ids in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of sim profile ids in a resource group. + * + * @param value the value value to set. + * @return the SimIdListResultInner object itself. + */ + public SimIdListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimInner.java new file mode 100644 index 000000000000..638208aa010c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimInner.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ConfigurationState; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Sim resource. */ +@Fluent +public final class SimInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimInner.class); + + /* + * Sim Properties. + */ + @JsonProperty(value = "properties", required = true) + private SimPropertiesFormat innerProperties = new SimPropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Sim Properties. + * + * @return the innerProperties value. + */ + private SimPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public SimInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SimInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the sim resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the configurationState property: The configuration state of the sim resource - complete or incomplete. + * + * @return the configurationState value. + */ + public ConfigurationState configurationState() { + return this.innerProperties() == null ? null : this.innerProperties().configurationState(); + } + + /** + * Get the internationalMobileSubscriberIdentity property: The International Mobile Subscriber Identity (IMSI) for + * the sim. + * + * @return the internationalMobileSubscriberIdentity value. + */ + public String internationalMobileSubscriberIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().internationalMobileSubscriberIdentity(); + } + + /** + * Set the internationalMobileSubscriberIdentity property: The International Mobile Subscriber Identity (IMSI) for + * the sim. + * + * @param internationalMobileSubscriberIdentity the internationalMobileSubscriberIdentity value to set. + * @return the SimInner object itself. + */ + public SimInner withInternationalMobileSubscriberIdentity(String internationalMobileSubscriberIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withInternationalMobileSubscriberIdentity(internationalMobileSubscriberIdentity); + return this; + } + + /** + * Get the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the sim. + * + * @return the integratedCircuitCardIdentifier value. + */ + public String integratedCircuitCardIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().integratedCircuitCardIdentifier(); + } + + /** + * Set the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the sim. + * + * @param integratedCircuitCardIdentifier the integratedCircuitCardIdentifier value to set. + * @return the SimInner object itself. + */ + public SimInner withIntegratedCircuitCardIdentifier(String integratedCircuitCardIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withIntegratedCircuitCardIdentifier(integratedCircuitCardIdentifier); + return this; + } + + /** + * Get the authenticationKey property: The ki value for the sim. + * + * @return the authenticationKey value. + */ + public String authenticationKey() { + return this.innerProperties() == null ? null : this.innerProperties().authenticationKey(); + } + + /** + * Set the authenticationKey property: The ki value for the sim. + * + * @param authenticationKey the authenticationKey value to set. + * @return the SimInner object itself. + */ + public SimInner withAuthenticationKey(String authenticationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withAuthenticationKey(authenticationKey); + return this; + } + + /** + * Get the operatorKeyCode property: The Opc value for the sim. + * + * @return the operatorKeyCode value. + */ + public String operatorKeyCode() { + return this.innerProperties() == null ? null : this.innerProperties().operatorKeyCode(); + } + + /** + * Set the operatorKeyCode property: The Opc value for the sim. + * + * @param operatorKeyCode the operatorKeyCode value to set. + * @return the SimInner object itself. + */ + public SimInner withOperatorKeyCode(String operatorKeyCode) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withOperatorKeyCode(operatorKeyCode); + return this; + } + + /** + * Get the mobileNetwork property: Mobile network that this sim belongs to. + * + * @return the mobileNetwork value. + */ + public MobileNetworkResourceId mobileNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().mobileNetwork(); + } + + /** + * Set the mobileNetwork property: Mobile network that this sim belongs to. + * + * @param mobileNetwork the mobileNetwork value to set. + * @return the SimInner object itself. + */ + public SimInner withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withMobileNetwork(mobileNetwork); + return this; + } + + /** + * Get the deviceType property: An optional free-form text field that can be used to record the device type this sim + * is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered based on + * this value. + * + * @return the deviceType value. + */ + public String deviceType() { + return this.innerProperties() == null ? null : this.innerProperties().deviceType(); + } + + /** + * Set the deviceType property: An optional free-form text field that can be used to record the device type this sim + * is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered based on + * this value. + * + * @param deviceType the deviceType value to set. + * @return the SimInner object itself. + */ + public SimInner withDeviceType(String deviceType) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withDeviceType(deviceType); + return this; + } + + /** + * Get the simPolicy property: The simPolicy used by this sim. + * + * @return the simPolicy value. + */ + public SimPolicyResourceId simPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().simPolicy(); + } + + /** + * Set the simPolicy property: The simPolicy used by this sim. + * + * @param simPolicy the simPolicy value to set. + * @return the SimInner object itself. + */ + public SimInner withSimPolicy(SimPolicyResourceId simPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withSimPolicy(simPolicy); + return this; + } + + /** + * Get the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, slice}. + * + * @return the staticIpConfiguration value. + */ + public List staticIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().staticIpConfiguration(); + } + + /** + * Set the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, slice}. + * + * @param staticIpConfiguration the staticIpConfiguration value to set. + * @return the SimInner object itself. + */ + public SimInner withStaticIpConfiguration(List staticIpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPropertiesFormat(); + } + this.innerProperties().withStaticIpConfiguration(staticIpConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SimInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyInner.java new file mode 100644 index 000000000000..04067d412b32 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyInner.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Sim policy resource. */ +@Fluent +public final class SimPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPolicyInner.class); + + /* + * Sim policy Properties. + */ + @JsonProperty(value = "properties", required = true) + private SimPolicyPropertiesFormat innerProperties = new SimPolicyPropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Sim policy Properties. + * + * @return the innerProperties value. + */ + private SimPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public SimPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SimPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the sim policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given + * UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * + * @return the ueAmbr value. + */ + public Ambr ueAmbr() { + return this.innerProperties() == null ? null : this.innerProperties().ueAmbr(); + } + + /** + * Set the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given + * UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * + * @param ueAmbr the ueAmbr value to set. + * @return the SimPolicyInner object itself. + */ + public SimPolicyInner withUeAmbr(Ambr ueAmbr) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPolicyPropertiesFormat(); + } + this.innerProperties().withUeAmbr(ueAmbr); + return this; + } + + /** + * Get the defaultSlice property: The default slice to use if the UE does not explicitly specify it. This slice must + * exist in the `sliceConfigurations` map. + * + * @return the defaultSlice value. + */ + public SliceResourceId defaultSlice() { + return this.innerProperties() == null ? null : this.innerProperties().defaultSlice(); + } + + /** + * Set the defaultSlice property: The default slice to use if the UE does not explicitly specify it. This slice must + * exist in the `sliceConfigurations` map. + * + * @param defaultSlice the defaultSlice value to set. + * @return the SimPolicyInner object itself. + */ + public SimPolicyInner withDefaultSlice(SliceResourceId defaultSlice) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPolicyPropertiesFormat(); + } + this.innerProperties().withDefaultSlice(defaultSlice); + return this; + } + + /** + * Get the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an + * optional setting and by default is unspecified. + * + * @return the rfspIndex value. + */ + public Integer rfspIndex() { + return this.innerProperties() == null ? null : this.innerProperties().rfspIndex(); + } + + /** + * Set the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an + * optional setting and by default is unspecified. + * + * @param rfspIndex the rfspIndex value to set. + * @return the SimPolicyInner object itself. + */ + public SimPolicyInner withRfspIndex(Integer rfspIndex) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPolicyPropertiesFormat(); + } + this.innerProperties().withRfspIndex(rfspIndex); + return this; + } + + /** + * Get the registrationTimer property: Interval for the UE periodic registration update procedure, in seconds. + * + * @return the registrationTimer value. + */ + public Integer registrationTimer() { + return this.innerProperties() == null ? null : this.innerProperties().registrationTimer(); + } + + /** + * Set the registrationTimer property: Interval for the UE periodic registration update procedure, in seconds. + * + * @param registrationTimer the registrationTimer value to set. + * @return the SimPolicyInner object itself. + */ + public SimPolicyInner withRegistrationTimer(Integer registrationTimer) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPolicyPropertiesFormat(); + } + this.innerProperties().withRegistrationTimer(registrationTimer); + return this; + } + + /** + * Get the sliceConfigurations property: The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + * + * @return the sliceConfigurations value. + */ + public List sliceConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().sliceConfigurations(); + } + + /** + * Set the sliceConfigurations property: The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + * + * @param sliceConfigurations the sliceConfigurations value to set. + * @return the SimPolicyInner object itself. + */ + public SimPolicyInner withSliceConfigurations(List sliceConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new SimPolicyPropertiesFormat(); + } + this.innerProperties().withSliceConfigurations(sliceConfigurations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SimPolicyInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyPropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyPropertiesFormat.java new file mode 100644 index 000000000000..86f494ac1747 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPolicyPropertiesFormat.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SimPolicy properties. */ +@Fluent +public final class SimPolicyPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPolicyPropertiesFormat.class); + + /* + * The provisioning state of the sim policy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Aggregate maximum bit rate across all non-GBR QoS flows of all PDU + * sessions of a given UE. See 3GPP TS23.501 section 5.7.2.6 for a full + * description of the UE-AMBR. + */ + @JsonProperty(value = "ueAmbr", required = true) + private Ambr ueAmbr; + + /* + * The default slice to use if the UE does not explicitly specify it. This + * slice must exist in the `sliceConfigurations` map. + */ + @JsonProperty(value = "defaultSlice", required = true) + private SliceResourceId defaultSlice; + + /* + * RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This + * is an optional setting and by default is unspecified. + */ + @JsonProperty(value = "rfspIndex") + private Integer rfspIndex; + + /* + * Interval for the UE periodic registration update procedure, in seconds. + */ + @JsonProperty(value = "registrationTimer") + private Integer registrationTimer; + + /* + * The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + */ + @JsonProperty(value = "sliceConfigurations", required = true) + private List sliceConfigurations; + + /** + * Get the provisioningState property: The provisioning state of the sim policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given + * UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * + * @return the ueAmbr value. + */ + public Ambr ueAmbr() { + return this.ueAmbr; + } + + /** + * Set the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given + * UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * + * @param ueAmbr the ueAmbr value to set. + * @return the SimPolicyPropertiesFormat object itself. + */ + public SimPolicyPropertiesFormat withUeAmbr(Ambr ueAmbr) { + this.ueAmbr = ueAmbr; + return this; + } + + /** + * Get the defaultSlice property: The default slice to use if the UE does not explicitly specify it. This slice must + * exist in the `sliceConfigurations` map. + * + * @return the defaultSlice value. + */ + public SliceResourceId defaultSlice() { + return this.defaultSlice; + } + + /** + * Set the defaultSlice property: The default slice to use if the UE does not explicitly specify it. This slice must + * exist in the `sliceConfigurations` map. + * + * @param defaultSlice the defaultSlice value to set. + * @return the SimPolicyPropertiesFormat object itself. + */ + public SimPolicyPropertiesFormat withDefaultSlice(SliceResourceId defaultSlice) { + this.defaultSlice = defaultSlice; + return this; + } + + /** + * Get the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an + * optional setting and by default is unspecified. + * + * @return the rfspIndex value. + */ + public Integer rfspIndex() { + return this.rfspIndex; + } + + /** + * Set the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an + * optional setting and by default is unspecified. + * + * @param rfspIndex the rfspIndex value to set. + * @return the SimPolicyPropertiesFormat object itself. + */ + public SimPolicyPropertiesFormat withRfspIndex(Integer rfspIndex) { + this.rfspIndex = rfspIndex; + return this; + } + + /** + * Get the registrationTimer property: Interval for the UE periodic registration update procedure, in seconds. + * + * @return the registrationTimer value. + */ + public Integer registrationTimer() { + return this.registrationTimer; + } + + /** + * Set the registrationTimer property: Interval for the UE periodic registration update procedure, in seconds. + * + * @param registrationTimer the registrationTimer value to set. + * @return the SimPolicyPropertiesFormat object itself. + */ + public SimPolicyPropertiesFormat withRegistrationTimer(Integer registrationTimer) { + this.registrationTimer = registrationTimer; + return this; + } + + /** + * Get the sliceConfigurations property: The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + * + * @return the sliceConfigurations value. + */ + public List sliceConfigurations() { + return this.sliceConfigurations; + } + + /** + * Set the sliceConfigurations property: The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + * + * @param sliceConfigurations the sliceConfigurations value to set. + * @return the SimPolicyPropertiesFormat object itself. + */ + public SimPolicyPropertiesFormat withSliceConfigurations(List sliceConfigurations) { + this.sliceConfigurations = sliceConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ueAmbr() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ueAmbr in model SimPolicyPropertiesFormat")); + } else { + ueAmbr().validate(); + } + if (defaultSlice() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property defaultSlice in model SimPolicyPropertiesFormat")); + } else { + defaultSlice().validate(); + } + if (sliceConfigurations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sliceConfigurations in model SimPolicyPropertiesFormat")); + } else { + sliceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPropertiesFormat.java new file mode 100644 index 000000000000..8548cf0c8f7e --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SimPropertiesFormat.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ConfigurationState; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sim properties. */ +@Fluent +public final class SimPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPropertiesFormat.class); + + /* + * The provisioning state of the sim resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The configuration state of the sim resource - complete or incomplete. + */ + @JsonProperty(value = "configurationState", access = JsonProperty.Access.WRITE_ONLY) + private ConfigurationState configurationState; + + /* + * The International Mobile Subscriber Identity (IMSI) for the sim. + */ + @JsonProperty(value = "internationalMobileSubscriberIdentity", required = true) + private String internationalMobileSubscriberIdentity; + + /* + * The Integrated Circuit Card ID (ICC Id) for the sim. + */ + @JsonProperty(value = "integratedCircuitCardIdentifier") + private String integratedCircuitCardIdentifier; + + /* + * The ki value for the sim. + */ + @JsonProperty(value = "authenticationKey") + private String authenticationKey; + + /* + * The Opc value for the sim. + */ + @JsonProperty(value = "operatorKeyCode") + private String operatorKeyCode; + + /* + * Mobile network that this sim belongs to + */ + @JsonProperty(value = "mobileNetwork") + private MobileNetworkResourceId mobileNetwork; + + /* + * An optional free-form text field that can be used to record the device + * type this sim is associated with, for example 'Video camera'. The Azure + * portal allows Sims to be grouped and filtered based on this value. + */ + @JsonProperty(value = "deviceType") + private String deviceType; + + /* + * The simPolicy used by this sim. + */ + @JsonProperty(value = "simPolicy") + private SimPolicyResourceId simPolicy; + + /* + * A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, + * slice}. + */ + @JsonProperty(value = "staticIpConfiguration") + private List staticIpConfiguration; + + /** + * Get the provisioningState property: The provisioning state of the sim resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the configurationState property: The configuration state of the sim resource - complete or incomplete. + * + * @return the configurationState value. + */ + public ConfigurationState configurationState() { + return this.configurationState; + } + + /** + * Get the internationalMobileSubscriberIdentity property: The International Mobile Subscriber Identity (IMSI) for + * the sim. + * + * @return the internationalMobileSubscriberIdentity value. + */ + public String internationalMobileSubscriberIdentity() { + return this.internationalMobileSubscriberIdentity; + } + + /** + * Set the internationalMobileSubscriberIdentity property: The International Mobile Subscriber Identity (IMSI) for + * the sim. + * + * @param internationalMobileSubscriberIdentity the internationalMobileSubscriberIdentity value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withInternationalMobileSubscriberIdentity(String internationalMobileSubscriberIdentity) { + this.internationalMobileSubscriberIdentity = internationalMobileSubscriberIdentity; + return this; + } + + /** + * Get the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the sim. + * + * @return the integratedCircuitCardIdentifier value. + */ + public String integratedCircuitCardIdentifier() { + return this.integratedCircuitCardIdentifier; + } + + /** + * Set the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the sim. + * + * @param integratedCircuitCardIdentifier the integratedCircuitCardIdentifier value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withIntegratedCircuitCardIdentifier(String integratedCircuitCardIdentifier) { + this.integratedCircuitCardIdentifier = integratedCircuitCardIdentifier; + return this; + } + + /** + * Get the authenticationKey property: The ki value for the sim. + * + * @return the authenticationKey value. + */ + public String authenticationKey() { + return this.authenticationKey; + } + + /** + * Set the authenticationKey property: The ki value for the sim. + * + * @param authenticationKey the authenticationKey value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withAuthenticationKey(String authenticationKey) { + this.authenticationKey = authenticationKey; + return this; + } + + /** + * Get the operatorKeyCode property: The Opc value for the sim. + * + * @return the operatorKeyCode value. + */ + public String operatorKeyCode() { + return this.operatorKeyCode; + } + + /** + * Set the operatorKeyCode property: The Opc value for the sim. + * + * @param operatorKeyCode the operatorKeyCode value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withOperatorKeyCode(String operatorKeyCode) { + this.operatorKeyCode = operatorKeyCode; + return this; + } + + /** + * Get the mobileNetwork property: Mobile network that this sim belongs to. + * + * @return the mobileNetwork value. + */ + public MobileNetworkResourceId mobileNetwork() { + return this.mobileNetwork; + } + + /** + * Set the mobileNetwork property: Mobile network that this sim belongs to. + * + * @param mobileNetwork the mobileNetwork value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + this.mobileNetwork = mobileNetwork; + return this; + } + + /** + * Get the deviceType property: An optional free-form text field that can be used to record the device type this sim + * is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered based on + * this value. + * + * @return the deviceType value. + */ + public String deviceType() { + return this.deviceType; + } + + /** + * Set the deviceType property: An optional free-form text field that can be used to record the device type this sim + * is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered based on + * this value. + * + * @param deviceType the deviceType value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withDeviceType(String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Get the simPolicy property: The simPolicy used by this sim. + * + * @return the simPolicy value. + */ + public SimPolicyResourceId simPolicy() { + return this.simPolicy; + } + + /** + * Set the simPolicy property: The simPolicy used by this sim. + * + * @param simPolicy the simPolicy value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withSimPolicy(SimPolicyResourceId simPolicy) { + this.simPolicy = simPolicy; + return this; + } + + /** + * Get the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, slice}. + * + * @return the staticIpConfiguration value. + */ + public List staticIpConfiguration() { + return this.staticIpConfiguration; + } + + /** + * Set the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, slice}. + * + * @param staticIpConfiguration the staticIpConfiguration value to set. + * @return the SimPropertiesFormat object itself. + */ + public SimPropertiesFormat withStaticIpConfiguration(List staticIpConfiguration) { + this.staticIpConfiguration = staticIpConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (internationalMobileSubscriberIdentity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property internationalMobileSubscriberIdentity in model" + + " SimPropertiesFormat")); + } + if (mobileNetwork() != null) { + mobileNetwork().validate(); + } + if (simPolicy() != null) { + simPolicy().validate(); + } + if (staticIpConfiguration() != null) { + staticIpConfiguration().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SiteInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SiteInner.java new file mode 100644 index 000000000000..fa69d3718f4a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SiteInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Site resource. */ +@Fluent +public final class SiteInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteInner.class); + + /* + * Site properties. + */ + @JsonProperty(value = "properties") + private SitePropertiesFormat innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Site properties. + * + * @return the innerProperties value. + */ + private SitePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public SiteInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SiteInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the site resource. **TODO**: Confirm if this is + * needed. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the networkFunctions property: An array of ids of the network functions deployed on the site, maintained by + * the user. + * + * @return the networkFunctions value. + */ + public List networkFunctions() { + return this.innerProperties() == null ? null : this.innerProperties().networkFunctions(); + } + + /** + * Set the networkFunctions property: An array of ids of the network functions deployed on the site, maintained by + * the user. + * + * @param networkFunctions the networkFunctions value to set. + * @return the SiteInner object itself. + */ + public SiteInner withNetworkFunctions(List networkFunctions) { + if (this.innerProperties() == null) { + this.innerProperties = new SitePropertiesFormat(); + } + this.innerProperties().withNetworkFunctions(networkFunctions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SitePropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SitePropertiesFormat.java new file mode 100644 index 000000000000..f135aae7e9a9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SitePropertiesFormat.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Site properties. */ +@Fluent +public final class SitePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SitePropertiesFormat.class); + + /* + * The provisioning state of the site resource. **TODO**: Confirm if this + * is needed + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * An array of ids of the network functions deployed on the site, + * maintained by the user. + */ + @JsonProperty(value = "networkFunctions") + private List networkFunctions; + + /** + * Get the provisioningState property: The provisioning state of the site resource. **TODO**: Confirm if this is + * needed. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the networkFunctions property: An array of ids of the network functions deployed on the site, maintained by + * the user. + * + * @return the networkFunctions value. + */ + public List networkFunctions() { + return this.networkFunctions; + } + + /** + * Set the networkFunctions property: An array of ids of the network functions deployed on the site, maintained by + * the user. + * + * @param networkFunctions the networkFunctions value to set. + * @return the SitePropertiesFormat object itself. + */ + public SitePropertiesFormat withNetworkFunctions(List networkFunctions) { + this.networkFunctions = networkFunctions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SliceInner.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SliceInner.java new file mode 100644 index 000000000000..98040e864730 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SliceInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.Snssai; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network slice resource. */ +@Fluent +public final class SliceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SliceInner.class); + + /* + * Slice properties. + */ + @JsonProperty(value = "properties", required = true) + private SlicePropertiesFormat innerProperties = new SlicePropertiesFormat(); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData innerSystemData; + + /** + * Get the innerProperties property: Slice properties. + * + * @return the innerProperties value. + */ + private SlicePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the innerSystemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the innerSystemData value. + */ + private SystemData innerSystemData() { + return this.innerSystemData; + } + + /** {@inheritDoc} */ + @Override + public SliceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SliceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network slice resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the snssai property: The S-NSSAI (single network slice selection assistance information). Unique at the scope + * of a MobileNetwork. + * + * @return the snssai value. + */ + public Snssai snssai() { + return this.innerProperties() == null ? null : this.innerProperties().snssai(); + } + + /** + * Set the snssai property: The S-NSSAI (single network slice selection assistance information). Unique at the scope + * of a MobileNetwork. + * + * @param snssai the snssai value to set. + * @return the SliceInner object itself. + */ + public SliceInner withSnssai(Snssai snssai) { + if (this.innerProperties() == null) { + this.innerProperties = new SlicePropertiesFormat(); + } + this.innerProperties().withSnssai(snssai); + return this; + } + + /** + * Get the description property: An optional description for this network slice. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: An optional description for this network slice. + * + * @param description the description value to set. + * @return the SliceInner object itself. + */ + public SliceInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SlicePropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SliceInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SlicePropertiesFormat.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SlicePropertiesFormat.java new file mode 100644 index 000000000000..cb6cef3faa77 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/SlicePropertiesFormat.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.Snssai; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network slice properties. */ +@Fluent +public final class SlicePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SlicePropertiesFormat.class); + + /* + * The provisioning state of the network slice resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The S-NSSAI (single network slice selection assistance information). + * Unique at the scope of a MobileNetwork. + */ + @JsonProperty(value = "snssai", required = true) + private Snssai snssai; + + /* + * An optional description for this network slice. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provisioningState property: The provisioning state of the network slice resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the snssai property: The S-NSSAI (single network slice selection assistance information). Unique at the scope + * of a MobileNetwork. + * + * @return the snssai value. + */ + public Snssai snssai() { + return this.snssai; + } + + /** + * Set the snssai property: The S-NSSAI (single network slice selection assistance information). Unique at the scope + * of a MobileNetwork. + * + * @param snssai the snssai value to set. + * @return the SlicePropertiesFormat object itself. + */ + public SlicePropertiesFormat withSnssai(Snssai snssai) { + this.snssai = snssai; + return this; + } + + /** + * Get the description property: An optional description for this network slice. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: An optional description for this network slice. + * + * @param description the description value to set. + * @return the SlicePropertiesFormat object itself. + */ + public SlicePropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (snssai() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property snssai in model SlicePropertiesFormat")); + } else { + snssai().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/package-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/package-info.java new file mode 100644 index 000000000000..bc49da853353 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for MobileNetworkManagementClient. The resources in this swagger + * specification will be used to manage attached data network resources in mobile network attached to a particular + * packet core instance. + */ +package com.azure.resourcemanager.mobilenetwork.fluent.models; diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/package-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/package-info.java new file mode 100644 index 000000000000..a7beb7674680 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/fluent/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for MobileNetworkManagementClient. The resources in this swagger specification + * will be used to manage attached data network resources in mobile network attached to a particular packet core + * instance. + */ +package com.azure.resourcemanager.mobilenetwork.fluent; diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java new file mode 100644 index 000000000000..b84c5a055d5b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AttachedDataNetworkImpl + implements AttachedDataNetwork, AttachedDataNetwork.Definition, AttachedDataNetwork.Update { + private AttachedDataNetworkInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InterfaceProperties userPlaneDataInterface() { + return this.innerModel().userPlaneDataInterface(); + } + + public NaptConfiguration naptConfiguration() { + return this.innerModel().naptConfiguration(); + } + + public List userEquipmentAddressPoolPrefix() { + List inner = this.innerModel().userEquipmentAddressPoolPrefix(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List userEquipmentStaticAddressPoolPrefix() { + List inner = this.innerModel().userEquipmentStaticAddressPoolPrefix(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AttachedDataNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String packetCoreControlPlaneName; + + private String packetCoreDataPlaneName; + + private String attachedDataNetworkName; + + private TagsObject updateParameters; + + public AttachedDataNetworkImpl withExistingPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + this.resourceGroupName = resourceGroupName; + this.packetCoreControlPlaneName = packetCoreControlPlaneName; + this.packetCoreDataPlaneName = packetCoreDataPlaneName; + return this; + } + + public AttachedDataNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .createOrUpdate( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.innerModel(), + Context.NONE); + return this; + } + + public AttachedDataNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .createOrUpdate( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.innerModel(), + context); + return this; + } + + AttachedDataNetworkImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new AttachedDataNetworkInner(); + this.serviceManager = serviceManager; + this.attachedDataNetworkName = name; + } + + public AttachedDataNetworkImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public AttachedDataNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .updateTagsWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public AttachedDataNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .updateTagsWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + updateParameters, + context) + .getValue(); + return this; + } + + AttachedDataNetworkImpl( + AttachedDataNetworkInner innerObject, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.packetCoreControlPlaneName = Utils.getValueFromIdByName(innerObject.id(), "packetCoreControlPlanes"); + this.packetCoreDataPlaneName = Utils.getValueFromIdByName(innerObject.id(), "packetCoreDataPlanes"); + this.attachedDataNetworkName = Utils.getValueFromIdByName(innerObject.id(), "attachedDataNetworks"); + } + + public AttachedDataNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .getWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + Context.NONE) + .getValue(); + return this; + } + + public AttachedDataNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDataNetworks() + .getWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context) + .getValue(); + return this; + } + + public AttachedDataNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AttachedDataNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AttachedDataNetworkImpl withUserPlaneDataInterface(InterfaceProperties userPlaneDataInterface) { + this.innerModel().withUserPlaneDataInterface(userPlaneDataInterface); + return this; + } + + public AttachedDataNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AttachedDataNetworkImpl withNaptConfiguration(NaptConfiguration naptConfiguration) { + this.innerModel().withNaptConfiguration(naptConfiguration); + return this; + } + + public AttachedDataNetworkImpl withUserEquipmentAddressPoolPrefix(List userEquipmentAddressPoolPrefix) { + this.innerModel().withUserEquipmentAddressPoolPrefix(userEquipmentAddressPoolPrefix); + return this; + } + + public AttachedDataNetworkImpl withUserEquipmentStaticAddressPoolPrefix( + List userEquipmentStaticAddressPoolPrefix) { + this.innerModel().withUserEquipmentStaticAddressPoolPrefix(userEquipmentStaticAddressPoolPrefix); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java new file mode 100644 index 000000000000..ede96456744e --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java @@ -0,0 +1,1699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.AttachedDataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AttachedDataNetworksClient. */ +public final class AttachedDataNetworksClientImpl implements AttachedDataNetworksClient { + private final ClientLogger logger = new ClientLogger(AttachedDataNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AttachedDataNetworksService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of AttachedDataNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AttachedDataNetworksClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AttachedDataNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientAttachedDataNetworks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface AttachedDataNetworksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}" + + "/attachedDataNetworks/{attachedDataNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @PathParam("attachedDataNetworkName") String attachedDataNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}" + + "/attachedDataNetworks/{attachedDataNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @PathParam("attachedDataNetworkName") String attachedDataNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}" + + "/attachedDataNetworks/{attachedDataNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @PathParam("attachedDataNetworkName") String attachedDataNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AttachedDataNetworkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}" + + "/attachedDataNetworks/{attachedDataNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @PathParam("attachedDataNetworkName") String attachedDataNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}" + + "/attachedDataNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPacketCoreDataPlane( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPacketCoreDataPlaneNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + return beginDeleteAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName) + .getSyncPoller(); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + return beginDeleteAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context) + .getSyncPoller(); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + return beginDeleteAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + return beginDeleteAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + deleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName) + .block(); + } + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + deleteAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context) + .block(); + } + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + return getWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDataNetworkInner get( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + return getAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName) + .block(); + } + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + return getWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context) + .block(); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AttachedDataNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDataNetworkInner.class, + AttachedDataNetworkInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AttachedDataNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDataNetworkInner.class, + AttachedDataNetworkInner.class, + context); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AttachedDataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters) + .getSyncPoller(); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of attached data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AttachedDataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDataNetworkInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters) { + return createOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters) + .block(); + } + + /** + * Creates or updates an attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to the create or update attached data network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDataNetworkInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + AttachedDataNetworkInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters, + context) + .block(); + } + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (attachedDataNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter attachedDataNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters) { + return updateTagsWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDataNetworkInner updateTags( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters) { + return updateTagsAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters) + .block(); + } + + /** + * Updates an attached data network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param parameters Parameters supplied to update attached data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return attached data network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + parameters, + context) + .block(); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreDataPlaneSinglePageAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPacketCoreDataPlane( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreDataPlaneSinglePageAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPacketCoreDataPlane( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPacketCoreDataPlaneAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return new PagedFlux<>( + () -> + listByPacketCoreDataPlaneSinglePageAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName), + nextLink -> listByPacketCoreDataPlaneNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPacketCoreDataPlaneAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + return new PagedFlux<>( + () -> + listByPacketCoreDataPlaneSinglePageAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context), + nextLink -> listByPacketCoreDataPlaneNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return new PagedIterable<>( + listByPacketCoreDataPlaneAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName)); + } + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + return new PagedIterable<>( + listByPacketCoreDataPlaneAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreDataPlaneNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPacketCoreDataPlaneNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreDataPlaneNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPacketCoreDataPlaneNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksImpl.java new file mode 100644 index 000000000000..4a543d73d846 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksImpl.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.AttachedDataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AttachedDataNetworksImpl implements AttachedDataNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDataNetworksImpl.class); + + private final AttachedDataNetworksClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public AttachedDataNetworksImpl( + AttachedDataNetworksClient innerClient, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + this + .serviceClient() + .delete(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName); + } + + public void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context); + } + + public AttachedDataNetwork get( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName) { + AttachedDataNetworkInner inner = + this + .serviceClient() + .get(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName); + if (inner != null) { + return new AttachedDataNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AttachedDataNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + PagedIterable inner = + this + .serviceClient() + .listByPacketCoreDataPlane(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName); + return Utils.mapPage(inner, inner1 -> new AttachedDataNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByPacketCoreDataPlane( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + return Utils.mapPage(inner, inner1 -> new AttachedDataNetworkImpl(inner1, this.manager())); + } + + public AttachedDataNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + String attachedDataNetworkName = Utils.getValueFromIdByName(id, "attachedDataNetworks"); + if (attachedDataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'attachedDataNetworks'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + String attachedDataNetworkName = Utils.getValueFromIdByName(id, "attachedDataNetworks"); + if (attachedDataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'attachedDataNetworks'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + String attachedDataNetworkName = Utils.getValueFromIdByName(id, "attachedDataNetworks"); + if (attachedDataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'attachedDataNetworks'.", + id))); + } + this + .delete( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + String attachedDataNetworkName = Utils.getValueFromIdByName(id, "attachedDataNetworks"); + if (attachedDataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'attachedDataNetworks'.", + id))); + } + this + .delete( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + attachedDataNetworkName, + context); + } + + private AttachedDataNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public AttachedDataNetworkImpl define(String name) { + return new AttachedDataNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java new file mode 100644 index 000000000000..40896fe4b2fc --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class DataNetworkImpl implements DataNetwork, DataNetwork.Definition, DataNetwork.Update { + private DataNetworkInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String description() { + return this.innerModel().description(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private String dataNetworkName; + + private TagsObject updateParameters; + + public DataNetworkImpl withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName) { + this.resourceGroupName = resourceGroupName; + this.mobileNetworkName = mobileNetworkName; + return this; + } + + public DataNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .createOrUpdate(resourceGroupName, mobileNetworkName, dataNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public DataNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .createOrUpdate(resourceGroupName, mobileNetworkName, dataNetworkName, this.innerModel(), context); + return this; + } + + DataNetworkImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new DataNetworkInner(); + this.serviceManager = serviceManager; + this.dataNetworkName = name; + } + + public DataNetworkImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public DataNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .updateTagsWithResponse( + resourceGroupName, mobileNetworkName, dataNetworkName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DataNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .updateTagsWithResponse( + resourceGroupName, mobileNetworkName, dataNetworkName, updateParameters, context) + .getValue(); + return this; + } + + DataNetworkImpl( + DataNetworkInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + this.dataNetworkName = Utils.getValueFromIdByName(innerObject.id(), "dataNetworks"); + } + + public DataNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, Context.NONE) + .getValue(); + return this; + } + + public DataNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataNetworks() + .getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, context) + .getValue(); + return this; + } + + public DataNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DataNetworkImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java new file mode 100644 index 000000000000..1489a96acb2c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java @@ -0,0 +1,1353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.DataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworkListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataNetworksClient. */ +public final class DataNetworksClientImpl implements DataNetworksClient { + private final ClientLogger logger = new ClientLogger(DataNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataNetworksService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of DataNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataNetworksClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy.create(DataNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientDataNetworks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface DataNetworksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("dataNetworkName") String dataNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("dataNetworkName") String dataNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("dataNetworkName") String dataNetworkName, + @BodyParam("application/json") DataNetworkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("dataNetworkName") String dataNetworkName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/dataNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetwork( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetworkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + accept, + context); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName).getSyncPoller(); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).getSyncPoller(); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + deleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName).block(); + } + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).block(); + } + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + accept, + context); + } + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataNetworkInner get(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + return getAsync(resourceGroupName, mobileNetworkName, dataNetworkName).block(); + } + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, context).block(); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + parameters, + accept, + context); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataNetworkInner.class, + DataNetworkInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataNetworkInner.class, DataNetworkInner.class, context); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of data network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, DataNetworkInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters).block(); + } + + /** + * Creates or updates a mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to the create or update mobile network dataNetwork operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataNetworkInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + DataNetworkInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context).block(); + } + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (dataNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + dataNetworkName, + parameters, + accept, + context); + } + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataNetworkInner updateTags( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters).block(); + } + + /** + * Update data network tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param parameters Parameters supplied to update data network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String mobileNetworkName, + String dataNetworkName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters, context) + .block(); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); + } + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksImpl.java new file mode 100644 index 000000000000..81769e508f4e --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.DataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataNetworksImpl implements DataNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworksImpl.class); + + private final DataNetworksClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public DataNetworksImpl( + DataNetworksClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, dataNetworkName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, dataNetworkName, context); + } + + public DataNetwork get(String resourceGroupName, String mobileNetworkName, String dataNetworkName) { + DataNetworkInner inner = this.serviceClient().get(resourceGroupName, mobileNetworkName, dataNetworkName); + if (inner != null) { + return new DataNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName); + return Utils.mapPage(inner, inner1 -> new DataNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName, context); + return Utils.mapPage(inner, inner1 -> new DataNetworkImpl(inner1, this.manager())); + } + + public DataNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String dataNetworkName = Utils.getValueFromIdByName(id, "dataNetworks"); + if (dataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String dataNetworkName = Utils.getValueFromIdByName(id, "dataNetworks"); + if (dataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, dataNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String dataNetworkName = Utils.getValueFromIdByName(id, "dataNetworks"); + if (dataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataNetworks'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, dataNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String dataNetworkName = Utils.getValueFromIdByName(id, "dataNetworks"); + if (dataNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataNetworks'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, dataNetworkName, context); + } + + private DataNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public DataNetworkImpl define(String name) { + return new DataNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java new file mode 100644 index 000000000000..d81200357354 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetwork; +import com.azure.resourcemanager.mobilenetwork.models.PlmnId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SimIdListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class MobileNetworkImpl implements MobileNetwork, MobileNetwork.Definition, MobileNetwork.Update { + private MobileNetworkInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PlmnId publicLandMobileNetworkIdentifier() { + return this.innerModel().publicLandMobileNetworkIdentifier(); + } + + public String serviceKey() { + return this.innerModel().serviceKey(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MobileNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private TagsObject updateParameters; + + public MobileNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MobileNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .createOrUpdate(resourceGroupName, mobileNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public MobileNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .createOrUpdate(resourceGroupName, mobileNetworkName, this.innerModel(), context); + return this; + } + + MobileNetworkImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new MobileNetworkInner(); + this.serviceManager = serviceManager; + this.mobileNetworkName = name; + } + + public MobileNetworkImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public MobileNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public MobileNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, updateParameters, context) + .getValue(); + return this; + } + + MobileNetworkImpl( + MobileNetworkInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + } + + public MobileNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .getByResourceGroupWithResponse(resourceGroupName, mobileNetworkName, Context.NONE) + .getValue(); + return this; + } + + public MobileNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMobileNetworks() + .getByResourceGroupWithResponse(resourceGroupName, mobileNetworkName, context) + .getValue(); + return this; + } + + public SimIdListResult listSimIds() { + return serviceManager.mobileNetworks().listSimIds(resourceGroupName, mobileNetworkName); + } + + public SimIdListResult listSimIds(Context context) { + return serviceManager.mobileNetworks().listSimIds(resourceGroupName, mobileNetworkName, context); + } + + public MobileNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MobileNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MobileNetworkImpl withPublicLandMobileNetworkIdentifier(PlmnId publicLandMobileNetworkIdentifier) { + this.innerModel().withPublicLandMobileNetworkIdentifier(publicLandMobileNetworkIdentifier); + return this; + } + + public MobileNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java new file mode 100644 index 000000000000..18f4656d5545 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the MobileNetworkManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {MobileNetworkManagementClientImpl.class}) +public final class MobileNetworkManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the MobileNetworkManagementClientBuilder. + */ + public MobileNetworkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MobileNetworkManagementClientImpl with the provided parameters. + * + * @return an instance of MobileNetworkManagementClientImpl. + */ + public MobileNetworkManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + MobileNetworkManagementClientImpl client = + new MobileNetworkManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java new file mode 100644 index 000000000000..159e2ff54aeb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mobilenetwork.fluent.AttachedDataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.DataNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.MobileNetworkManagementClient; +import com.azure.resourcemanager.mobilenetwork.fluent.MobileNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.OperationsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreControlPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreDataPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.ServicesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.SimPoliciesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.SimsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.SitesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.SlicesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the MobileNetworkManagementClientImpl type. */ +@ServiceClient(builder = MobileNetworkManagementClientBuilder.class) +public final class MobileNetworkManagementClientImpl implements MobileNetworkManagementClient { + private final ClientLogger logger = new ClientLogger(MobileNetworkManagementClientImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The AttachedDataNetworksClient object to access its operations. */ + private final AttachedDataNetworksClient attachedDataNetworks; + + /** + * Gets the AttachedDataNetworksClient object to access its operations. + * + * @return the AttachedDataNetworksClient object. + */ + public AttachedDataNetworksClient getAttachedDataNetworks() { + return this.attachedDataNetworks; + } + + /** The DataNetworksClient object to access its operations. */ + private final DataNetworksClient dataNetworks; + + /** + * Gets the DataNetworksClient object to access its operations. + * + * @return the DataNetworksClient object. + */ + public DataNetworksClient getDataNetworks() { + return this.dataNetworks; + } + + /** The MobileNetworksClient object to access its operations. */ + private final MobileNetworksClient mobileNetworks; + + /** + * Gets the MobileNetworksClient object to access its operations. + * + * @return the MobileNetworksClient object. + */ + public MobileNetworksClient getMobileNetworks() { + return this.mobileNetworks; + } + + /** The SitesClient object to access its operations. */ + private final SitesClient sites; + + /** + * Gets the SitesClient object to access its operations. + * + * @return the SitesClient object. + */ + public SitesClient getSites() { + return this.sites; + } + + /** The SimsClient object to access its operations. */ + private final SimsClient sims; + + /** + * Gets the SimsClient object to access its operations. + * + * @return the SimsClient object. + */ + public SimsClient getSims() { + return this.sims; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The PacketCoreControlPlanesClient object to access its operations. */ + private final PacketCoreControlPlanesClient packetCoreControlPlanes; + + /** + * Gets the PacketCoreControlPlanesClient object to access its operations. + * + * @return the PacketCoreControlPlanesClient object. + */ + public PacketCoreControlPlanesClient getPacketCoreControlPlanes() { + return this.packetCoreControlPlanes; + } + + /** The PacketCoreDataPlanesClient object to access its operations. */ + private final PacketCoreDataPlanesClient packetCoreDataPlanes; + + /** + * Gets the PacketCoreDataPlanesClient object to access its operations. + * + * @return the PacketCoreDataPlanesClient object. + */ + public PacketCoreDataPlanesClient getPacketCoreDataPlanes() { + return this.packetCoreDataPlanes; + } + + /** The ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The SimPoliciesClient object to access its operations. */ + private final SimPoliciesClient simPolicies; + + /** + * Gets the SimPoliciesClient object to access its operations. + * + * @return the SimPoliciesClient object. + */ + public SimPoliciesClient getSimPolicies() { + return this.simPolicies; + } + + /** The SlicesClient object to access its operations. */ + private final SlicesClient slices; + + /** + * Gets the SlicesClient object to access its operations. + * + * @return the SlicesClient object. + */ + public SlicesClient getSlices() { + return this.slices; + } + + /** + * Initializes an instance of MobileNetworkManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + MobileNetworkManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-01-01-preview"; + this.attachedDataNetworks = new AttachedDataNetworksClientImpl(this); + this.dataNetworks = new DataNetworksClientImpl(this); + this.mobileNetworks = new MobileNetworksClientImpl(this); + this.sites = new SitesClientImpl(this); + this.sims = new SimsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.packetCoreControlPlanes = new PacketCoreControlPlanesClientImpl(this); + this.packetCoreDataPlanes = new PacketCoreDataPlanesClientImpl(this); + this.services = new ServicesClientImpl(this); + this.simPolicies = new SimPoliciesClientImpl(this); + this.slices = new SlicesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksClientImpl.java new file mode 100644 index 000000000000..acd48206804a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksClientImpl.java @@ -0,0 +1,1722 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.MobileNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MobileNetworksClient. */ +public final class MobileNetworksClientImpl implements MobileNetworksClient { + private final ClientLogger logger = new ClientLogger(MobileNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MobileNetworksService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of MobileNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MobileNetworksClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy.create(MobileNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientMobileNetworks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface MobileNetworksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @BodyParam("application/json") MobileNetworkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/mobileNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/listSimIds") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listSimIds( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String mobileNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, mobileNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, mobileNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String mobileNetworkName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName).getSyncPoller(); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, context).getSyncPoller(); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName) { + deleteAsync(resourceGroupName, mobileNetworkName).block(); + } + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, context).block(); + } + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context); + } + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String mobileNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, mobileNetworkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MobileNetworkInner getByResourceGroup(String resourceGroupName, String mobileNetworkName) { + return getByResourceGroupAsync(resourceGroupName, mobileNetworkName).block(); + } + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String mobileNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, mobileNetworkName, context).block(); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + parameters, + accept, + context); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MobileNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MobileNetworkInner.class, + MobileNetworkInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MobileNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MobileNetworkInner.class, MobileNetworkInner.class, context); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MobileNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of mobile network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MobileNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MobileNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters).block(); + } + + /** + * Creates or updates a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to the create or update mobile network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MobileNetworkInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, MobileNetworkInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, parameters, context).block(); + } + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + parameters, + accept, + context); + } + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MobileNetworkInner updateTags(String resourceGroupName, String mobileNetworkName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, parameters).block(); + } + + /** + * Updates a mobile network update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param parameters Parameters supplied to update mobile network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mobile network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, parameters, context).block(); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the mobile networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSimIdsWithResponseAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSimIds( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSimIdsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSimIds( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + accept, + context); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimIdListResultInner> beginListSimIdsAsync( + String resourceGroupName, String mobileNetworkName) { + Mono>> mono = listSimIdsWithResponseAsync(resourceGroupName, mobileNetworkName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SimIdListResultInner.class, + SimIdListResultInner.class, + this.client.getContext()); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimIdListResultInner> beginListSimIdsAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listSimIdsWithResponseAsync(resourceGroupName, mobileNetworkName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SimIdListResultInner.class, SimIdListResultInner.class, context); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimIdListResultInner> beginListSimIds( + String resourceGroupName, String mobileNetworkName) { + return beginListSimIdsAsync(resourceGroupName, mobileNetworkName).getSyncPoller(); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimIdListResultInner> beginListSimIds( + String resourceGroupName, String mobileNetworkName, Context context) { + return beginListSimIdsAsync(resourceGroupName, mobileNetworkName, context).getSyncPoller(); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSimIdsAsync(String resourceGroupName, String mobileNetworkName) { + return beginListSimIdsAsync(resourceGroupName, mobileNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSimIdsAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return beginListSimIdsAsync(resourceGroupName, mobileNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimIdListResultInner listSimIds(String resourceGroupName, String mobileNetworkName) { + return listSimIdsAsync(resourceGroupName, mobileNetworkName).block(); + } + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimIdListResultInner listSimIds(String resourceGroupName, String mobileNetworkName, Context context) { + return listSimIdsAsync(resourceGroupName, mobileNetworkName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksImpl.java new file mode 100644 index 000000000000..30b169595bfb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworksImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.MobileNetworksClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetwork; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworks; +import com.azure.resourcemanager.mobilenetwork.models.SimIdListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MobileNetworksImpl implements MobileNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobileNetworksImpl.class); + + private final MobileNetworksClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public MobileNetworksImpl( + MobileNetworksClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String mobileNetworkName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, context); + } + + public MobileNetwork getByResourceGroup(String resourceGroupName, String mobileNetworkName) { + MobileNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, mobileNetworkName); + if (inner != null) { + return new MobileNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String mobileNetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, mobileNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MobileNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new MobileNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new MobileNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new MobileNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new MobileNetworkImpl(inner1, this.manager())); + } + + public SimIdListResult listSimIds(String resourceGroupName, String mobileNetworkName) { + SimIdListResultInner inner = this.serviceClient().listSimIds(resourceGroupName, mobileNetworkName); + if (inner != null) { + return new SimIdListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SimIdListResult listSimIds(String resourceGroupName, String mobileNetworkName, Context context) { + SimIdListResultInner inner = this.serviceClient().listSimIds(resourceGroupName, mobileNetworkName, context); + if (inner != null) { + return new SimIdListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public MobileNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, mobileNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, mobileNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, context); + } + + private MobileNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public MobileNetworkImpl define(String name) { + return new MobileNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationImpl.java new file mode 100644 index 000000000000..5fd1a99ccc22 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.mobilenetwork.models.Operation; +import com.azure.resourcemanager.mobilenetwork.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..98fe29213100 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.OperationsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.mobilenetwork.models.OperationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.MobileNetwork/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of the operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsImpl.java new file mode 100644 index 000000000000..50bc65ff4191 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.OperationsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; +import com.azure.resourcemanager.mobilenetwork.models.Operation; +import com.azure.resourcemanager.mobilenetwork.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlaneImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlaneImpl.java new file mode 100644 index 000000000000..fdc651eb9bb6 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlaneImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; +import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class PacketCoreControlPlaneImpl + implements PacketCoreControlPlane, PacketCoreControlPlane.Definition, PacketCoreControlPlane.Update { + private PacketCoreControlPlaneInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public MobileNetworkResourceId mobileNetwork() { + return this.innerModel().mobileNetwork(); + } + + public CustomLocationResourceId customLocation() { + return this.innerModel().customLocation(); + } + + public CoreNetworkType coreNetworkTechnology() { + return this.innerModel().coreNetworkTechnology(); + } + + public String version() { + return this.innerModel().version(); + } + + public InterfaceProperties controlPlaneAccessInterface() { + return this.innerModel().controlPlaneAccessInterface(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PacketCoreControlPlaneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String packetCoreControlPlaneName; + + private TagsObject updateParameters; + + public PacketCoreControlPlaneImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PacketCoreControlPlane create() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .createOrUpdate(resourceGroupName, packetCoreControlPlaneName, this.innerModel(), Context.NONE); + return this; + } + + public PacketCoreControlPlane create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .createOrUpdate(resourceGroupName, packetCoreControlPlaneName, this.innerModel(), context); + return this; + } + + PacketCoreControlPlaneImpl( + String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new PacketCoreControlPlaneInner(); + this.serviceManager = serviceManager; + this.packetCoreControlPlaneName = name; + } + + public PacketCoreControlPlaneImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public PacketCoreControlPlane apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .updateTagsWithResponse(resourceGroupName, packetCoreControlPlaneName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public PacketCoreControlPlane apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .updateTagsWithResponse(resourceGroupName, packetCoreControlPlaneName, updateParameters, context) + .getValue(); + return this; + } + + PacketCoreControlPlaneImpl( + PacketCoreControlPlaneInner innerObject, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.packetCoreControlPlaneName = Utils.getValueFromIdByName(innerObject.id(), "packetCoreControlPlanes"); + } + + public PacketCoreControlPlane refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .getByResourceGroupWithResponse(resourceGroupName, packetCoreControlPlaneName, Context.NONE) + .getValue(); + return this; + } + + public PacketCoreControlPlane refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreControlPlanes() + .getByResourceGroupWithResponse(resourceGroupName, packetCoreControlPlaneName, context) + .getValue(); + return this; + } + + public PacketCoreControlPlaneImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PacketCoreControlPlaneImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PacketCoreControlPlaneImpl withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + this.innerModel().withMobileNetwork(mobileNetwork); + return this; + } + + public PacketCoreControlPlaneImpl withControlPlaneAccessInterface(InterfaceProperties controlPlaneAccessInterface) { + this.innerModel().withControlPlaneAccessInterface(controlPlaneAccessInterface); + return this; + } + + public PacketCoreControlPlaneImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PacketCoreControlPlaneImpl withCustomLocation(CustomLocationResourceId customLocation) { + this.innerModel().withCustomLocation(customLocation); + return this; + } + + public PacketCoreControlPlaneImpl withCoreNetworkTechnology(CoreNetworkType coreNetworkTechnology) { + this.innerModel().withCoreNetworkTechnology(coreNetworkTechnology); + return this; + } + + public PacketCoreControlPlaneImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesClientImpl.java new file mode 100644 index 000000000000..695acac6c29d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesClientImpl.java @@ -0,0 +1,1506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreControlPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlaneListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PacketCoreControlPlanesClient. */ +public final class PacketCoreControlPlanesClientImpl implements PacketCoreControlPlanesClient { + private final ClientLogger logger = new ClientLogger(PacketCoreControlPlanesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PacketCoreControlPlanesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCoreControlPlanesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PacketCoreControlPlanesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(PacketCoreControlPlanesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientPacketCoreControlPlanes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface PacketCoreControlPlanesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PacketCoreControlPlaneInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, packetCoreControlPlaneName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String packetCoreControlPlaneName) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName).getSyncPoller(); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, context).getSyncPoller(); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String packetCoreControlPlaneName) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String packetCoreControlPlaneName, Context context) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String packetCoreControlPlaneName) { + deleteAsync(resourceGroupName, packetCoreControlPlaneName).block(); + } + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String packetCoreControlPlaneName, Context context) { + deleteAsync(resourceGroupName, packetCoreControlPlaneName, context).block(); + } + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, packetCoreControlPlaneName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreControlPlaneInner getByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName) { + return getByResourceGroupAsync(resourceGroupName, packetCoreControlPlaneName).block(); + } + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, context).block(); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PacketCoreControlPlaneInner> beginCreateOrUpdateAsync( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCoreControlPlaneInner.class, + PacketCoreControlPlaneInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PacketCoreControlPlaneInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCoreControlPlaneInner.class, + PacketCoreControlPlaneInner.class, + context); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCoreControlPlaneInner> beginCreateOrUpdate( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCoreControlPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreControlPlaneInner createOrUpdate( + String resourceGroupName, String packetCoreControlPlaneName, PacketCoreControlPlaneInner parameters) { + return createOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters).block(); + } + + /** + * Creates or updates a PacketCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to the create or update packet core control plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreControlPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + PacketCoreControlPlaneInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, parameters, context).block(); + } + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreControlPlaneInner updateTags( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, packetCoreControlPlaneName, parameters).block(); + } + + /** + * Updates a PacketCoreControlPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param parameters Parameters supplied to update PacketCoreControlPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core control plane resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, parameters, context).block(); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesImpl.java new file mode 100644 index 000000000000..3be9708682a8 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreControlPlanesImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreControlPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlanes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PacketCoreControlPlanesImpl implements PacketCoreControlPlanes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreControlPlanesImpl.class); + + private final PacketCoreControlPlanesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public PacketCoreControlPlanesImpl( + PacketCoreControlPlanesClient innerClient, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName) { + this.serviceClient().delete(resourceGroupName, packetCoreControlPlaneName); + } + + public void delete(String resourceGroupName, String packetCoreControlPlaneName, Context context) { + this.serviceClient().delete(resourceGroupName, packetCoreControlPlaneName, context); + } + + public PacketCoreControlPlane getByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName) { + PacketCoreControlPlaneInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, packetCoreControlPlaneName); + if (inner != null) { + return new PacketCoreControlPlaneImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, packetCoreControlPlaneName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PacketCoreControlPlaneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PacketCoreControlPlaneImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PacketCoreControlPlaneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PacketCoreControlPlaneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PacketCoreControlPlaneImpl(inner1, this.manager())); + } + + public PacketCoreControlPlane getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, packetCoreControlPlaneName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, packetCoreControlPlaneName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + this.delete(resourceGroupName, packetCoreControlPlaneName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + this.delete(resourceGroupName, packetCoreControlPlaneName, context); + } + + private PacketCoreControlPlanesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public PacketCoreControlPlaneImpl define(String name) { + return new PacketCoreControlPlaneImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlaneImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlaneImpl.java new file mode 100644 index 000000000000..938fad08dcf7 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlaneImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class PacketCoreDataPlaneImpl + implements PacketCoreDataPlane, PacketCoreDataPlane.Definition, PacketCoreDataPlane.Update { + private PacketCoreDataPlaneInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InterfaceProperties userPlaneAccessInterface() { + return this.innerModel().userPlaneAccessInterface(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PacketCoreDataPlaneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String packetCoreControlPlaneName; + + private String packetCoreDataPlaneName; + + private TagsObject updateParameters; + + public PacketCoreDataPlaneImpl withExistingPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName) { + this.resourceGroupName = resourceGroupName; + this.packetCoreControlPlaneName = packetCoreControlPlaneName; + return this; + } + + public PacketCoreDataPlane create() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .createOrUpdate( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.innerModel(), + Context.NONE); + return this; + } + + public PacketCoreDataPlane create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .createOrUpdate( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, this.innerModel(), context); + return this; + } + + PacketCoreDataPlaneImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new PacketCoreDataPlaneInner(); + this.serviceManager = serviceManager; + this.packetCoreDataPlaneName = name; + } + + public PacketCoreDataPlaneImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public PacketCoreDataPlane apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .updateTagsWithResponse( + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + updateParameters, + Context.NONE) + .getValue(); + return this; + } + + public PacketCoreDataPlane apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .updateTagsWithResponse( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, updateParameters, context) + .getValue(); + return this; + } + + PacketCoreDataPlaneImpl( + PacketCoreDataPlaneInner innerObject, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.packetCoreControlPlaneName = Utils.getValueFromIdByName(innerObject.id(), "packetCoreControlPlanes"); + this.packetCoreDataPlaneName = Utils.getValueFromIdByName(innerObject.id(), "packetCoreDataPlanes"); + } + + public PacketCoreDataPlane refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .getWithResponse(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, Context.NONE) + .getValue(); + return this; + } + + public PacketCoreDataPlane refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPacketCoreDataPlanes() + .getWithResponse(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context) + .getValue(); + return this; + } + + public PacketCoreDataPlaneImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PacketCoreDataPlaneImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PacketCoreDataPlaneImpl withUserPlaneAccessInterface(InterfaceProperties userPlaneAccessInterface) { + this.innerModel().withUserPlaneAccessInterface(userPlaneAccessInterface); + return this; + } + + public PacketCoreDataPlaneImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesClientImpl.java new file mode 100644 index 000000000000..3295e6a3515a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesClientImpl.java @@ -0,0 +1,1436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreDataPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlaneListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PacketCoreDataPlanesClient. */ +public final class PacketCoreDataPlanesClientImpl implements PacketCoreDataPlanesClient { + private final ClientLogger logger = new ClientLogger(PacketCoreDataPlanesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PacketCoreDataPlanesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCoreDataPlanesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PacketCoreDataPlanesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy + .create(PacketCoreDataPlanesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientPacketCoreDataPlanes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface PacketCoreDataPlanesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes" + + "/{packetCoreDataPlaneName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes" + + "/{packetCoreDataPlaneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes" + + "/{packetCoreDataPlaneName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PacketCoreDataPlaneInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes" + + "/{packetCoreDataPlaneName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @PathParam("packetCoreDataPlaneName") String packetCoreDataPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPacketCoreControlPlane( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("packetCoreControlPlaneName") String packetCoreControlPlaneName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPacketCoreControlPlaneNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName).getSyncPoller(); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + return beginDeleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + deleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName).block(); + } + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + deleteAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context).block(); + } + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return getWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreDataPlaneInner get( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + return getAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName).block(); + } + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + return getWithResponseAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context) + .block(); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PacketCoreDataPlaneInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCoreDataPlaneInner.class, + PacketCoreDataPlaneInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PacketCoreDataPlaneInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PacketCoreDataPlaneInner.class, + PacketCoreDataPlaneInner.class, + context); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCoreDataPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCoreDataPlaneInner> beginCreateOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreDataPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters) { + return createOrUpdateAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters) + .block(); + } + + /** + * Creates or updates a PacketCoreDataPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to the create or update packet core data plane operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreDataPlaneInner createOrUpdate( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + PacketCoreDataPlaneInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, context) + .block(); + } + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (packetCoreDataPlaneName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter packetCoreDataPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + packetCoreDataPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters) { + return updateTagsWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCoreDataPlaneInner updateTags( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters) { + return updateTagsAsync(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters) + .block(); + } + + /** + * Updates a PacketCoreDataPlane update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param parameters Parameters supplied to update PacketCoreDataPlane tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return packet core data plane resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync( + resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, parameters, context) + .block(); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreControlPlaneSinglePageAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPacketCoreControlPlane( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreControlPlaneSinglePageAsync( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (packetCoreControlPlaneName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter packetCoreControlPlaneName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPacketCoreControlPlane( + this.client.getEndpoint(), + resourceGroupName, + packetCoreControlPlaneName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPacketCoreControlPlaneAsync( + String resourceGroupName, String packetCoreControlPlaneName) { + return new PagedFlux<>( + () -> listByPacketCoreControlPlaneSinglePageAsync(resourceGroupName, packetCoreControlPlaneName), + nextLink -> listByPacketCoreControlPlaneNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPacketCoreControlPlaneAsync( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + return new PagedFlux<>( + () -> listByPacketCoreControlPlaneSinglePageAsync(resourceGroupName, packetCoreControlPlaneName, context), + nextLink -> listByPacketCoreControlPlaneNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName) { + return new PagedIterable<>(listByPacketCoreControlPlaneAsync(resourceGroupName, packetCoreControlPlaneName)); + } + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + return new PagedIterable<>( + listByPacketCoreControlPlaneAsync(resourceGroupName, packetCoreControlPlaneName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreControlPlaneNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.listByPacketCoreControlPlaneNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPacketCoreControlPlaneNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPacketCoreControlPlaneNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesImpl.java new file mode 100644 index 000000000000..cbdbfc3bbd5d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/PacketCoreDataPlanesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.PacketCoreDataPlanesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlanes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PacketCoreDataPlanesImpl implements PacketCoreDataPlanes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreDataPlanesImpl.class); + + private final PacketCoreDataPlanesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public PacketCoreDataPlanesImpl( + PacketCoreDataPlanesClient innerClient, + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + this.serviceClient().delete(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName); + } + + public void delete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + this.serviceClient().delete(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + } + + public PacketCoreDataPlane get( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName) { + PacketCoreDataPlaneInner inner = + this.serviceClient().get(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName); + if (inner != null) { + return new PacketCoreDataPlaneImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PacketCoreDataPlaneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName) { + PagedIterable inner = + this.serviceClient().listByPacketCoreControlPlane(resourceGroupName, packetCoreControlPlaneName); + return Utils.mapPage(inner, inner1 -> new PacketCoreDataPlaneImpl(inner1, this.manager())); + } + + public PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName, Context context) { + PagedIterable inner = + this.serviceClient().listByPacketCoreControlPlane(resourceGroupName, packetCoreControlPlaneName, context); + return Utils.mapPage(inner, inner1 -> new PacketCoreDataPlaneImpl(inner1, this.manager())); + } + + public PacketCoreDataPlane getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + return this + .getWithResponse(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + return this.getWithResponse(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + this.delete(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String packetCoreControlPlaneName = Utils.getValueFromIdByName(id, "packetCoreControlPlanes"); + if (packetCoreControlPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreControlPlanes'.", + id))); + } + String packetCoreDataPlaneName = Utils.getValueFromIdByName(id, "packetCoreDataPlanes"); + if (packetCoreDataPlaneName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'packetCoreDataPlanes'.", + id))); + } + this.delete(resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, context); + } + + private PacketCoreDataPlanesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public PacketCoreDataPlaneImpl define(String name) { + return new PacketCoreDataPlaneImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServiceImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServiceImpl.java new file mode 100644 index 000000000000..a382cafa1236 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServiceImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; +import com.azure.resourcemanager.mobilenetwork.models.Service; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ServiceImpl implements Service, Service.Definition, Service.Update { + private ServiceInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public int servicePrecedence() { + return this.innerModel().servicePrecedence(); + } + + public QosPolicy serviceQosPolicy() { + return this.innerModel().serviceQosPolicy(); + } + + public List pccRules() { + List inner = this.innerModel().pccRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private String serviceName; + + private TagsObject updateParameters; + + public ServiceImpl withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName) { + this.resourceGroupName = resourceGroupName; + this.mobileNetworkName = mobileNetworkName; + return this; + } + + public Service create() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(resourceGroupName, mobileNetworkName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public Service create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(resourceGroupName, mobileNetworkName, serviceName, this.innerModel(), context); + return this; + } + + ServiceImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new ServiceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public ServiceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Service apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .updateTagsWithResponse( + resourceGroupName, mobileNetworkName, serviceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Service apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, serviceName, updateParameters, context) + .getValue(); + return this; + } + + ServiceImpl(ServiceInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + } + + public Service refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getWithResponse(resourceGroupName, mobileNetworkName, serviceName, Context.NONE) + .getValue(); + return this; + } + + public Service refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getWithResponse(resourceGroupName, mobileNetworkName, serviceName, context) + .getValue(); + return this; + } + + public ServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServiceImpl withServicePrecedence(int servicePrecedence) { + this.innerModel().withServicePrecedence(servicePrecedence); + return this; + } + + public ServiceImpl withPccRules(List pccRules) { + this.innerModel().withPccRules(pccRules); + return this; + } + + public ServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ServiceImpl withServiceQosPolicy(QosPolicy serviceQosPolicy) { + this.innerModel().withServiceQosPolicy(serviceQosPolicy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesClientImpl.java new file mode 100644 index 000000000000..d3aa744bc6de --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesClientImpl.java @@ -0,0 +1,1367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.ServicesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import com.azure.resourcemanager.mobilenetwork.models.ServiceListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public final class ServicesClientImpl implements ServicesClient { + private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of ServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServicesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface ServicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/services/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/services/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/services/{serviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/services/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/services") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetwork( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetworkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String serviceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String serviceName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, serviceName).getSyncPoller(); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, serviceName, context).getSyncPoller(); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, String serviceName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, serviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String serviceName) { + deleteAsync(resourceGroupName, mobileNetworkName, serviceName).block(); + } + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, serviceName, context).block(); + } + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String mobileNetworkName, String serviceName) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceInner get(String resourceGroupName, String mobileNetworkName, String serviceName) { + return getAsync(resourceGroupName, mobileNetworkName, serviceName).block(); + } + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, context).block(); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceInner.class, ServiceInner.class, this.client.getContext()); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceInner.class, ServiceInner.class, context); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String serviceName, ServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters).block(); + } + + /** + * Creates or updates a Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to the create or update service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + ServiceInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, serviceName, parameters, context).block(); + } + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + serviceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + serviceName, + parameters, + accept, + context); + } + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, String serviceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceInner updateTags( + String resourceGroupName, String mobileNetworkName, String serviceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, serviceName, parameters).block(); + } + + /** + * Update service tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param parameters Parameters supplied to update service tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String mobileNetworkName, + String serviceName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, serviceName, parameters, context) + .block(); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMobileNetwork( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetwork( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); + } + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Services API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Services API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesImpl.java new file mode 100644 index 000000000000..386882e130dc --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/ServicesImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.ServicesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import com.azure.resourcemanager.mobilenetwork.models.Service; +import com.azure.resourcemanager.mobilenetwork.models.Services; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServicesImpl implements Services { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + + private final ServicesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public ServicesImpl( + ServicesClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String mobileNetworkName, String serviceName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, serviceName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, serviceName, context); + } + + public Service get(String resourceGroupName, String mobileNetworkName, String serviceName) { + ServiceInner inner = this.serviceClient().get(resourceGroupName, mobileNetworkName, serviceName); + if (inner != null) { + return new ServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, mobileNetworkName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName); + return Utils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName, context); + return Utils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); + } + + public Service getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, serviceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, serviceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, serviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, serviceName, context); + } + + private ServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public ServiceImpl define(String name) { + return new ServiceImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimIdListResultImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimIdListResultImpl.java new file mode 100644 index 000000000000..d13c6a02fd6b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimIdListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner; +import com.azure.resourcemanager.mobilenetwork.models.SimIdListResult; +import java.util.Collections; +import java.util.List; + +public final class SimIdListResultImpl implements SimIdListResult { + private SimIdListResultInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + SimIdListResultImpl( + SimIdListResultInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public SimIdListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimImpl.java new file mode 100644 index 000000000000..4d9830126445 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import com.azure.resourcemanager.mobilenetwork.models.ConfigurationState; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.Sim; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SimImpl implements Sim, Sim.Definition, Sim.Update { + private SimInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConfigurationState configurationState() { + return this.innerModel().configurationState(); + } + + public String internationalMobileSubscriberIdentity() { + return this.innerModel().internationalMobileSubscriberIdentity(); + } + + public String integratedCircuitCardIdentifier() { + return this.innerModel().integratedCircuitCardIdentifier(); + } + + public String authenticationKey() { + return this.innerModel().authenticationKey(); + } + + public String operatorKeyCode() { + return this.innerModel().operatorKeyCode(); + } + + public MobileNetworkResourceId mobileNetwork() { + return this.innerModel().mobileNetwork(); + } + + public String deviceType() { + return this.innerModel().deviceType(); + } + + public SimPolicyResourceId simPolicy() { + return this.innerModel().simPolicy(); + } + + public List staticIpConfiguration() { + List inner = this.innerModel().staticIpConfiguration(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SimInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String simName; + + private TagsObject updateParameters; + + public SimImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Sim create() { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .createOrUpdate(resourceGroupName, simName, this.innerModel(), Context.NONE); + return this; + } + + public Sim create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .createOrUpdate(resourceGroupName, simName, this.innerModel(), context); + return this; + } + + SimImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new SimInner(); + this.serviceManager = serviceManager; + this.simName = name; + } + + public SimImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Sim apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .updateTagsWithResponse(resourceGroupName, simName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Sim apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .updateTagsWithResponse(resourceGroupName, simName, updateParameters, context) + .getValue(); + return this; + } + + SimImpl(SimInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.simName = Utils.getValueFromIdByName(innerObject.id(), "sims"); + } + + public Sim refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .getByResourceGroupWithResponse(resourceGroupName, simName, Context.NONE) + .getValue(); + return this; + } + + public Sim refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSims() + .getByResourceGroupWithResponse(resourceGroupName, simName, context) + .getValue(); + return this; + } + + public SimImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SimImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SimImpl withInternationalMobileSubscriberIdentity(String internationalMobileSubscriberIdentity) { + this.innerModel().withInternationalMobileSubscriberIdentity(internationalMobileSubscriberIdentity); + return this; + } + + public SimImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SimImpl withIntegratedCircuitCardIdentifier(String integratedCircuitCardIdentifier) { + this.innerModel().withIntegratedCircuitCardIdentifier(integratedCircuitCardIdentifier); + return this; + } + + public SimImpl withAuthenticationKey(String authenticationKey) { + this.innerModel().withAuthenticationKey(authenticationKey); + return this; + } + + public SimImpl withOperatorKeyCode(String operatorKeyCode) { + this.innerModel().withOperatorKeyCode(operatorKeyCode); + return this; + } + + public SimImpl withMobileNetwork(MobileNetworkResourceId mobileNetwork) { + this.innerModel().withMobileNetwork(mobileNetwork); + return this; + } + + public SimImpl withDeviceType(String deviceType) { + this.innerModel().withDeviceType(deviceType); + return this; + } + + public SimImpl withSimPolicy(SimPolicyResourceId simPolicy) { + this.innerModel().withSimPolicy(simPolicy); + return this; + } + + public SimImpl withStaticIpConfiguration(List staticIpConfiguration) { + this.innerModel().withStaticIpConfiguration(staticIpConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesClientImpl.java new file mode 100644 index 000000000000..2162471be2e1 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesClientImpl.java @@ -0,0 +1,1344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.SimPoliciesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SimPoliciesClient. */ +public final class SimPoliciesClientImpl implements SimPoliciesClient { + private final ClientLogger logger = new ClientLogger(SimPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SimPoliciesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of SimPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SimPoliciesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = + RestProxy.create(SimPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientSimPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface SimPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("simPolicyName") String simPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("simPolicyName") String simPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("simPolicyName") String simPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SimPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("simPolicyName") String simPolicyName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/simPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetwork( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetworkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String simPolicyName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, simPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, simPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, simPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, simPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + deleteAsync(resourceGroupName, mobileNetworkName, simPolicyName).block(); + } + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, simPolicyName, context).block(); + } + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimPolicyInner get(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + return getAsync(resourceGroupName, mobileNetworkName, simPolicyName).block(); + } + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, context).block(); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + simPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SimPolicyInner.class, + SimPolicyInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimPolicyInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SimPolicyInner.class, SimPolicyInner.class, context); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimPolicyInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String simPolicyName, SimPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters).block(); + } + + /** + * Creates or updates a SimPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to the create or update sim policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimPolicyInner createOrUpdate( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + SimPolicyInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters, context).block(); + } + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + simPolicyName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (simPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter simPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + simPolicyName, + parameters, + accept, + context); + } + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, String simPolicyName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimPolicyInner updateTags( + String resourceGroupName, String mobileNetworkName, String simPolicyName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters).block(); + } + + /** + * Update sim policy tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param parameters Parameters supplied to update Sim Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim policy resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String mobileNetworkName, + String simPolicyName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, simPolicyName, parameters, context) + .block(); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMobileNetwork( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetwork( + this.client.getEndpoint(), + resourceGroupName, + mobileNetworkName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); + } + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for SimPolicies API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for SimPolicies API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesImpl.java new file mode 100644 index 000000000000..9e0e366c9342 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPoliciesImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.SimPoliciesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicies; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SimPoliciesImpl implements SimPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPoliciesImpl.class); + + private final SimPoliciesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public SimPoliciesImpl( + SimPoliciesClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, simPolicyName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, simPolicyName, context); + } + + public SimPolicy get(String resourceGroupName, String mobileNetworkName, String simPolicyName) { + SimPolicyInner inner = this.serviceClient().get(resourceGroupName, mobileNetworkName, simPolicyName); + if (inner != null) { + return new SimPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SimPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName); + return Utils.mapPage(inner, inner1 -> new SimPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SimPolicyImpl(inner1, this.manager())); + } + + public SimPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String simPolicyName = Utils.getValueFromIdByName(id, "simPolicies"); + if (simPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'simPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String simPolicyName = Utils.getValueFromIdByName(id, "simPolicies"); + if (simPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'simPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String simPolicyName = Utils.getValueFromIdByName(id, "simPolicies"); + if (simPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'simPolicies'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, simPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String simPolicyName = Utils.getValueFromIdByName(id, "simPolicies"); + if (simPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'simPolicies'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, simPolicyName, context); + } + + private SimPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public SimPolicyImpl define(String name) { + return new SimPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPolicyImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPolicyImpl.java new file mode 100644 index 000000000000..c34c95267f1e --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimPolicyImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; +import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SimPolicyImpl implements SimPolicy, SimPolicy.Definition, SimPolicy.Update { + private SimPolicyInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Ambr ueAmbr() { + return this.innerModel().ueAmbr(); + } + + public SliceResourceId defaultSlice() { + return this.innerModel().defaultSlice(); + } + + public Integer rfspIndex() { + return this.innerModel().rfspIndex(); + } + + public Integer registrationTimer() { + return this.innerModel().registrationTimer(); + } + + public List sliceConfigurations() { + List inner = this.innerModel().sliceConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SimPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private String simPolicyName; + + private TagsObject updateParameters; + + public SimPolicyImpl withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName) { + this.resourceGroupName = resourceGroupName; + this.mobileNetworkName = mobileNetworkName; + return this; + } + + public SimPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .createOrUpdate(resourceGroupName, mobileNetworkName, simPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public SimPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .createOrUpdate(resourceGroupName, mobileNetworkName, simPolicyName, this.innerModel(), context); + return this; + } + + SimPolicyImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new SimPolicyInner(); + this.serviceManager = serviceManager; + this.simPolicyName = name; + } + + public SimPolicyImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public SimPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .updateTagsWithResponse( + resourceGroupName, mobileNetworkName, simPolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SimPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, updateParameters, context) + .getValue(); + return this; + } + + SimPolicyImpl( + SimPolicyInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + this.simPolicyName = Utils.getValueFromIdByName(innerObject.id(), "simPolicies"); + } + + public SimPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .getWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, Context.NONE) + .getValue(); + return this; + } + + public SimPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSimPolicies() + .getWithResponse(resourceGroupName, mobileNetworkName, simPolicyName, context) + .getValue(); + return this; + } + + public SimPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SimPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SimPolicyImpl withUeAmbr(Ambr ueAmbr) { + this.innerModel().withUeAmbr(ueAmbr); + return this; + } + + public SimPolicyImpl withDefaultSlice(SliceResourceId defaultSlice) { + this.innerModel().withDefaultSlice(defaultSlice); + return this; + } + + public SimPolicyImpl withSliceConfigurations(List sliceConfigurations) { + this.innerModel().withSliceConfigurations(sliceConfigurations); + return this; + } + + public SimPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SimPolicyImpl withRfspIndex(Integer rfspIndex) { + this.innerModel().withRfspIndex(rfspIndex); + return this; + } + + public SimPolicyImpl withRegistrationTimer(Integer registrationTimer) { + this.innerModel().withRegistrationTimer(registrationTimer); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsClientImpl.java new file mode 100644 index 000000000000..b7d02f035ec3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsClientImpl.java @@ -0,0 +1,1428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.SimsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import com.azure.resourcemanager.mobilenetwork.models.SimListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SimsClient. */ +public final class SimsClientImpl implements SimsClient { + private final ClientLogger logger = new ClientLogger(SimsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SimsService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of SimsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SimsClientImpl(MobileNetworkManagementClientImpl client) { + this.service = RestProxy.create(SimsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientSims to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface SimsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims" + + "/{simName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("simName") String simName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims" + + "/{simName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("simName") String simName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims" + + "/{simName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("simName") String simName, + @BodyParam("application/json") SimInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims" + + "/{simName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("simName") String simName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/sims") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/sims") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String simName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String simName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + accept, + context); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String simName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, simName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String simName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, simName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String simName) { + return beginDeleteAsync(resourceGroupName, simName).getSyncPoller(); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String simName, Context context) { + return beginDeleteAsync(resourceGroupName, simName, context).getSyncPoller(); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String simName) { + return beginDeleteAsync(resourceGroupName, simName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String simName, Context context) { + return beginDeleteAsync(resourceGroupName, simName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String simName) { + deleteAsync(resourceGroupName, simName).block(); + } + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String simName, Context context) { + deleteAsync(resourceGroupName, simName, context).block(); + } + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String simName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String simName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + accept, + context); + } + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String simName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, simName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimInner getByResourceGroup(String resourceGroupName, String simName) { + return getByResourceGroupAsync(resourceGroupName, simName).block(); + } + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String simName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, simName, context).block(); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String simName, SimInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String simName, SimInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + parameters, + accept, + context); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimInner> beginCreateOrUpdateAsync( + String resourceGroupName, String simName, SimInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, simName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SimInner.class, SimInner.class, this.client.getContext()); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SimInner> beginCreateOrUpdateAsync( + String resourceGroupName, String simName, SimInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, simName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SimInner.class, SimInner.class, context); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimInner> beginCreateOrUpdate( + String resourceGroupName, String simName, SimInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, simName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sim resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SimInner> beginCreateOrUpdate( + String resourceGroupName, String simName, SimInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, simName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String simName, SimInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, simName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String simName, SimInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, simName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimInner createOrUpdate(String resourceGroupName, String simName, SimInner parameters) { + return createOrUpdateAsync(resourceGroupName, simName, parameters).block(); + } + + /** + * Creates or updates a Sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to the create or update sim operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimInner createOrUpdate(String resourceGroupName, String simName, SimInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, simName, parameters, context).block(); + } + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String simName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String simName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (simName == null) { + return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + simName, + parameters, + accept, + context); + } + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String simName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, simName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SimInner updateTags(String resourceGroupName, String simName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, simName, parameters).block(); + } + + /** + * Updates a sim update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param parameters Parameters supplied to update sim tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sim resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String simName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, simName, parameters, context).block(); + } + + /** + * Gets all the sims in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the sims in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the sims in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the sims in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the sims in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the sims in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list Sims API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list Sims API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list Sims API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list Sims API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsImpl.java new file mode 100644 index 000000000000..9338d397fd61 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SimsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.SimsClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import com.azure.resourcemanager.mobilenetwork.models.Sim; +import com.azure.resourcemanager.mobilenetwork.models.Sims; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SimsImpl implements Sims { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimsImpl.class); + + private final SimsClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public SimsImpl( + SimsClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String simName) { + this.serviceClient().delete(resourceGroupName, simName); + } + + public void delete(String resourceGroupName, String simName, Context context) { + this.serviceClient().delete(resourceGroupName, simName, context); + } + + public Sim getByResourceGroup(String resourceGroupName, String simName) { + SimInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, simName); + if (inner != null) { + return new SimImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String simName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, simName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SimImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SimImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SimImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SimImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SimImpl(inner1, this.manager())); + } + + public Sim getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String simName = Utils.getValueFromIdByName(id, "sims"); + if (simName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sims'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, simName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String simName = Utils.getValueFromIdByName(id, "sims"); + if (simName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sims'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, simName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String simName = Utils.getValueFromIdByName(id, "sims"); + if (simName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sims'.", id))); + } + this.delete(resourceGroupName, simName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String simName = Utils.getValueFromIdByName(id, "sims"); + if (simName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sims'.", id))); + } + this.delete(resourceGroupName, simName, context); + } + + private SimsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public SimImpl define(String name) { + return new SimImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SiteImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SiteImpl.java new file mode 100644 index 000000000000..9639fd5a4d14 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SiteImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.Site; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SiteImpl implements Site, Site.Definition, Site.Update { + private SiteInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List networkFunctions() { + List inner = this.innerModel().networkFunctions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private String siteName; + + private TagsObject updateParameters; + + public SiteImpl withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName) { + this.resourceGroupName = resourceGroupName; + this.mobileNetworkName = mobileNetworkName; + return this; + } + + public Site create() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .createOrUpdate(resourceGroupName, mobileNetworkName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public Site create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .createOrUpdate(resourceGroupName, mobileNetworkName, siteName, this.innerModel(), context); + return this; + } + + SiteImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new SiteInner(); + this.serviceManager = serviceManager; + this.siteName = name; + } + + public SiteImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Site apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, siteName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Site apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, siteName, updateParameters, context) + .getValue(); + return this; + } + + SiteImpl(SiteInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + this.siteName = Utils.getValueFromIdByName(innerObject.id(), "sites"); + } + + public Site refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .getWithResponse(resourceGroupName, mobileNetworkName, siteName, Context.NONE) + .getValue(); + return this; + } + + public Site refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSites() + .getWithResponse(resourceGroupName, mobileNetworkName, siteName, context) + .getValue(); + return this; + } + + public SiteImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SiteImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SiteImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SiteImpl withNetworkFunctions(List networkFunctions) { + this.innerModel().withNetworkFunctions(networkFunctions); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesClientImpl.java new file mode 100644 index 000000000000..a1b1287ddeb2 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesClientImpl.java @@ -0,0 +1,1307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.SitesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.mobilenetwork.models.SiteListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SitesClient. */ +public final class SitesClientImpl implements SitesClient { + private final ClientLogger logger = new ClientLogger(SitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SitesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of SitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SitesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = RestProxy.create(SitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientSites to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface SitesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/sites/{siteName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("siteName") String siteName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/sites/{siteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("siteName") String siteName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/sites/{siteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("siteName") String siteName, + @BodyParam("application/json") SiteInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/sites/{siteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("siteName") String siteName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/sites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetwork( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetworkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + accept, + context); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String siteName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, mobileNetworkName, siteName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String siteName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, siteName).getSyncPoller(); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, siteName, context).getSyncPoller(); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, String siteName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, siteName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, siteName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String siteName) { + deleteAsync(resourceGroupName, mobileNetworkName, siteName).block(); + } + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, siteName, context).block(); + } + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + accept, + context); + } + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String mobileNetworkName, String siteName) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, siteName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteInner get(String resourceGroupName, String mobileNetworkName, String siteName) { + return getAsync(resourceGroupName, mobileNetworkName, siteName).block(); + } + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, context).block(); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + parameters, + accept, + context); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, this.client.getContext()); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SiteInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class, context); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters).block(); + } + + /** + * Creates or updates a mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to the create or update mobile network site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String siteName, SiteInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, siteName, parameters, context).block(); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (siteName == null) { + return Mono.error(new IllegalArgumentException("Parameter siteName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + siteName, + parameters, + accept, + context); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteInner updateTags( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, siteName, parameters).block(); + } + + /** + * Updates a site update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param parameters Parameters supplied to update network site tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, siteName, parameters, context).block(); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); + } + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesImpl.java new file mode 100644 index 000000000000..53338874ebae --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SitesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.SitesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import com.azure.resourcemanager.mobilenetwork.models.Site; +import com.azure.resourcemanager.mobilenetwork.models.Sites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SitesImpl implements Sites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SitesImpl.class); + + private final SitesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public SitesImpl( + SitesClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String mobileNetworkName, String siteName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, siteName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, siteName, context); + } + + public Site get(String resourceGroupName, String mobileNetworkName, String siteName) { + SiteInner inner = this.serviceClient().get(resourceGroupName, mobileNetworkName, siteName); + if (inner != null) { + return new SiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, mobileNetworkName, siteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + PagedIterable inner = this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SiteImpl(inner1, this.manager())); + } + + public Site getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, siteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, siteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, siteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String siteName = Utils.getValueFromIdByName(id, "sites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sites'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, siteName, context); + } + + private SitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public SiteImpl define(String name) { + return new SiteImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SliceImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SliceImpl.java new file mode 100644 index 000000000000..98289af44566 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SliceImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState; +import com.azure.resourcemanager.mobilenetwork.models.Slice; +import com.azure.resourcemanager.mobilenetwork.models.Snssai; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SliceImpl implements Slice, Slice.Definition, Slice.Update { + private SliceInner innerObject; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Snssai snssai() { + return this.innerModel().snssai(); + } + + public String description() { + return this.innerModel().description(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SliceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String mobileNetworkName; + + private String sliceName; + + private TagsObject updateParameters; + + public SliceImpl withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName) { + this.resourceGroupName = resourceGroupName; + this.mobileNetworkName = mobileNetworkName; + return this; + } + + public Slice create() { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .createOrUpdate(resourceGroupName, mobileNetworkName, sliceName, this.innerModel(), Context.NONE); + return this; + } + + public Slice create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .createOrUpdate(resourceGroupName, mobileNetworkName, sliceName, this.innerModel(), context); + return this; + } + + SliceImpl(String name, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = new SliceInner(); + this.serviceManager = serviceManager; + this.sliceName = name; + } + + public SliceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Slice apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, sliceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Slice apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .updateTagsWithResponse(resourceGroupName, mobileNetworkName, sliceName, updateParameters, context) + .getValue(); + return this; + } + + SliceImpl(SliceInner innerObject, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.mobileNetworkName = Utils.getValueFromIdByName(innerObject.id(), "mobileNetworks"); + this.sliceName = Utils.getValueFromIdByName(innerObject.id(), "slices"); + } + + public Slice refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .getWithResponse(resourceGroupName, mobileNetworkName, sliceName, Context.NONE) + .getValue(); + return this; + } + + public Slice refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSlices() + .getWithResponse(resourceGroupName, mobileNetworkName, sliceName, context) + .getValue(); + return this; + } + + public SliceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SliceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SliceImpl withSnssai(Snssai snssai) { + this.innerModel().withSnssai(snssai); + return this; + } + + public SliceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SliceImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesClientImpl.java new file mode 100644 index 000000000000..15bdb2e33d30 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesClientImpl.java @@ -0,0 +1,1309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mobilenetwork.fluent.SlicesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import com.azure.resourcemanager.mobilenetwork.models.SliceListResult; +import com.azure.resourcemanager.mobilenetwork.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SlicesClient. */ +public final class SlicesClientImpl implements SlicesClient { + private final ClientLogger logger = new ClientLogger(SlicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SlicesService service; + + /** The service client containing this operation class. */ + private final MobileNetworkManagementClientImpl client; + + /** + * Initializes an instance of SlicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SlicesClientImpl(MobileNetworkManagementClientImpl client) { + this.service = RestProxy.create(SlicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MobileNetworkManagementClientSlices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MobileNetworkManagem") + private interface SlicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/slices/{sliceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("sliceName") String sliceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/slices/{sliceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("sliceName") String sliceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/slices/{sliceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("sliceName") String sliceName, + @BodyParam("application/json") SliceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/slices/{sliceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("mobileNetworkName") String mobileNetworkName, + @PathParam("sliceName") String sliceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork" + + "/mobileNetworks/{mobileNetworkName}/slices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetwork( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("mobileNetworkName") String mobileNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMobileNetworkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + accept, + context); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String sliceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String sliceName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, sliceName).getSyncPoller(); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, sliceName, context).getSyncPoller(); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String mobileNetworkName, String sliceName) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, sliceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + return beginDeleteAsync(resourceGroupName, mobileNetworkName, sliceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String sliceName) { + deleteAsync(resourceGroupName, mobileNetworkName, sliceName).block(); + } + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + deleteAsync(resourceGroupName, mobileNetworkName, sliceName, context).block(); + } + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + accept, + context); + } + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String mobileNetworkName, String sliceName) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SliceInner get(String resourceGroupName, String mobileNetworkName, String sliceName) { + return getAsync(resourceGroupName, mobileNetworkName, sliceName).block(); + } + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + return getWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, context).block(); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + parameters, + accept, + context); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SliceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SliceInner.class, SliceInner.class, this.client.getContext()); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SliceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SliceInner.class, SliceInner.class, context); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SliceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network slice resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SliceInner> beginCreateOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SliceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters).block(); + } + + /** + * Creates or updates a mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to the create or update mobile network slice operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SliceInner createOrUpdate( + String resourceGroupName, String mobileNetworkName, String sliceName, SliceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, mobileNetworkName, sliceName, parameters, context).block(); + } + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + if (sliceName == null) { + return Mono.error(new IllegalArgumentException("Parameter sliceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + mobileNetworkName, + sliceName, + parameters, + accept, + context); + } + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SliceInner updateTags( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, mobileNetworkName, sliceName, parameters).block(); + } + + /** + * Update slice tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param parameters Parameters supplied to update mobile network slice tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network slice resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, sliceName, parameters, context) + .block(); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkSinglePageAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (mobileNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter mobileNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetwork( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + mobileNetworkName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync(String resourceGroupName, String mobileNetworkName) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink)); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByMobileNetworkAsync( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedFlux<>( + () -> listByMobileNetworkSinglePageAsync(resourceGroupName, mobileNetworkName, context), + nextLink -> listByMobileNetworkNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName)); + } + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + return new PagedIterable<>(listByMobileNetworkAsync(resourceGroupName, mobileNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMobileNetworkNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMobileNetworkNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesImpl.java new file mode 100644 index 000000000000..5549011e9d80 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/SlicesImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.SlicesClient; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import com.azure.resourcemanager.mobilenetwork.models.Slice; +import com.azure.resourcemanager.mobilenetwork.models.Slices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SlicesImpl implements Slices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SlicesImpl.class); + + private final SlicesClient innerClient; + + private final com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager; + + public SlicesImpl( + SlicesClient innerClient, com.azure.resourcemanager.mobilenetwork.MobileNetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String mobileNetworkName, String sliceName) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, sliceName); + } + + public void delete(String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + this.serviceClient().delete(resourceGroupName, mobileNetworkName, sliceName, context); + } + + public Slice get(String resourceGroupName, String mobileNetworkName, String sliceName) { + SliceInner inner = this.serviceClient().get(resourceGroupName, mobileNetworkName, sliceName); + if (inner != null) { + return new SliceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, mobileNetworkName, sliceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SliceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName); + return Utils.mapPage(inner, inner1 -> new SliceImpl(inner1, this.manager())); + } + + public PagedIterable listByMobileNetwork( + String resourceGroupName, String mobileNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listByMobileNetwork(resourceGroupName, mobileNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SliceImpl(inner1, this.manager())); + } + + public Slice getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String sliceName = Utils.getValueFromIdByName(id, "slices"); + if (sliceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'slices'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, sliceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String sliceName = Utils.getValueFromIdByName(id, "slices"); + if (sliceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'slices'.", id))); + } + return this.getWithResponse(resourceGroupName, mobileNetworkName, sliceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String sliceName = Utils.getValueFromIdByName(id, "slices"); + if (sliceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'slices'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, sliceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks"); + if (mobileNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id))); + } + String sliceName = Utils.getValueFromIdByName(id, "slices"); + if (sliceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'slices'.", id))); + } + this.delete(resourceGroupName, mobileNetworkName, sliceName, context); + } + + private SlicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager() { + return this.serviceManager; + } + + public SliceImpl define(String name) { + return new SliceImpl(name, this.manager()); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/Utils.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/Utils.java new file mode 100644 index 000000000000..4a861297b560 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/package-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/package-info.java new file mode 100644 index 000000000000..4b56f3388d67 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for MobileNetworkManagementClient. The resources in this swagger specification + * will be used to manage attached data network resources in mobile network attached to a particular packet core + * instance. + */ +package com.azure.resourcemanager.mobilenetwork.implementation; diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Ambr.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Ambr.java new file mode 100644 index 000000000000..73f715744864 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Ambr.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Aggregate Maximum Bit Rate. */ +@Fluent +public final class Ambr { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ambr.class); + + /* + * Uplink bit rate. + */ + @JsonProperty(value = "uplink", required = true) + private String uplink; + + /* + * Downlink bit rate. + */ + @JsonProperty(value = "downlink", required = true) + private String downlink; + + /** + * Get the uplink property: Uplink bit rate. + * + * @return the uplink value. + */ + public String uplink() { + return this.uplink; + } + + /** + * Set the uplink property: Uplink bit rate. + * + * @param uplink the uplink value to set. + * @return the Ambr object itself. + */ + public Ambr withUplink(String uplink) { + this.uplink = uplink; + return this; + } + + /** + * Get the downlink property: Downlink bit rate. + * + * @return the downlink value. + */ + public String downlink() { + return this.downlink; + } + + /** + * Set the downlink property: Downlink bit rate. + * + * @param downlink the downlink value to set. + * @return the Ambr object itself. + */ + public Ambr withDownlink(String downlink) { + this.downlink = downlink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uplink() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property uplink in model Ambr")); + } + if (downlink() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property downlink in model Ambr")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetwork.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetwork.java new file mode 100644 index 000000000000..1729c860a971 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetwork.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of AttachedDataNetwork. */ +public interface AttachedDataNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the attached data network resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the userPlaneDataInterface property: The user plane interface on the data network. In 5G networks this is + * called as N6 interface whereas in 4G networks this is called as SGi interface. + * + * @return the userPlaneDataInterface value. + */ + InterfaceProperties userPlaneDataInterface(); + + /** + * Gets the naptConfiguration property: The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * + * @return the naptConfiguration value. + */ + NaptConfiguration naptConfiguration(); + + /** + * Gets the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentAddressPoolPrefix value. + */ + List userEquipmentAddressPoolPrefix(); + + /** + * Gets the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The mapping of + * static IP to sim is configured in staticIpConfiguration on the sim resource. At least one of + * userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined then + * they must be the same size. + * + * @return the userEquipmentStaticAddressPoolPrefix value. + */ + List userEquipmentStaticAddressPoolPrefix(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner object. + * + * @return the inner object. + */ + AttachedDataNetworkInner innerModel(); + + /** The entirety of the AttachedDataNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithUserPlaneDataInterface, + DefinitionStages.WithCreate { + } + /** The AttachedDataNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the AttachedDataNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AttachedDataNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the AttachedDataNetwork definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @return the next definition stage. + */ + WithUserPlaneDataInterface withExistingPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + } + /** The stage of the AttachedDataNetwork definition allowing to specify userPlaneDataInterface. */ + interface WithUserPlaneDataInterface { + /** + * Specifies the userPlaneDataInterface property: The user plane interface on the data network. In 5G + * networks this is called as N6 interface whereas in 4G networks this is called as SGi interface.. + * + * @param userPlaneDataInterface The user plane interface on the data network. In 5G networks this is called + * as N6 interface whereas in 4G networks this is called as SGi interface. + * @return the next definition stage. + */ + WithCreate withUserPlaneDataInterface(InterfaceProperties userPlaneDataInterface); + } + /** + * The stage of the AttachedDataNetwork definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithNaptConfiguration, + DefinitionStages.WithUserEquipmentAddressPoolPrefix, + DefinitionStages.WithUserEquipmentStaticAddressPoolPrefix { + /** + * Executes the create request. + * + * @return the created resource. + */ + AttachedDataNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AttachedDataNetwork create(Context context); + } + /** The stage of the AttachedDataNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the AttachedDataNetwork definition allowing to specify naptConfiguration. */ + interface WithNaptConfiguration { + /** + * Specifies the naptConfiguration property: The Network Address and Port Translation configuration. If not + * specified the attached data network uses a default NAPT configuration with NAPT enabled.. + * + * @param naptConfiguration The Network Address and Port Translation configuration. If not specified the + * attached data network uses a default NAPT configuration with NAPT enabled. + * @return the next definition stage. + */ + WithCreate withNaptConfiguration(NaptConfiguration naptConfiguration); + } + /** The stage of the AttachedDataNetwork definition allowing to specify userEquipmentAddressPoolPrefix. */ + interface WithUserEquipmentAddressPoolPrefix { + /** + * Specifies the userEquipmentAddressPoolPrefix property: The user equipment address pool prefixes for the + * attached data network that are dynamically assigned by the core to UEs when they set up a PDU session. At + * least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If + * both are defined then they must be the same size.. + * + * @param userEquipmentAddressPoolPrefix The user equipment address pool prefixes for the attached data + * network that are dynamically assigned by the core to UEs when they set up a PDU session. At least one + * of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both + * are defined then they must be the same size. + * @return the next definition stage. + */ + WithCreate withUserEquipmentAddressPoolPrefix(List userEquipmentAddressPoolPrefix); + } + /** The stage of the AttachedDataNetwork definition allowing to specify userEquipmentStaticAddressPoolPrefix. */ + interface WithUserEquipmentStaticAddressPoolPrefix { + /** + * Specifies the userEquipmentStaticAddressPoolPrefix property: The user equipment address pool prefixes for + * the attached data network that are statically assigned by the core to UEs when they set up a PDU session. + * The mapping of static IP to sim is configured in staticIpConfiguration on the sim resource. At least one + * of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are + * defined then they must be the same size.. + * + * @param userEquipmentStaticAddressPoolPrefix The user equipment address pool prefixes for the attached + * data network that are statically assigned by the core to UEs when they set up a PDU session. The + * mapping of static IP to sim is configured in staticIpConfiguration on the sim resource. At least one + * of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both + * are defined then they must be the same size. + * @return the next definition stage. + */ + WithCreate withUserEquipmentStaticAddressPoolPrefix(List userEquipmentStaticAddressPoolPrefix); + } + } + /** + * Begins update for the AttachedDataNetwork resource. + * + * @return the stage of resource update. + */ + AttachedDataNetwork.Update update(); + + /** The template for AttachedDataNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AttachedDataNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AttachedDataNetwork apply(Context context); + } + /** The AttachedDataNetwork update stages. */ + interface UpdateStages { + /** The stage of the AttachedDataNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AttachedDataNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AttachedDataNetwork refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkListResult.java new file mode 100644 index 000000000000..6ce38da705de --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.AttachedDataNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for attached data network API service call. */ +@Fluent +public final class AttachedDataNetworkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDataNetworkListResult.class); + + /* + * A list of data networks in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of data networks in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of data networks in a resource group. + * + * @param value the value value to set. + * @return the AttachedDataNetworkListResult object itself. + */ + public AttachedDataNetworkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkResourceId.java new file mode 100644 index 000000000000..f7474901d48c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworkResourceId.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to an Attached Data Network resource. */ +@Fluent +public final class AttachedDataNetworkResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDataNetworkResourceId.class); + + /* + * Attached Data Network resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Attached Data Network resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Attached Data Network resource ID. + * + * @param id the id value to set. + * @return the AttachedDataNetworkResourceId object itself. + */ + public AttachedDataNetworkResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property id in model AttachedDataNetworkResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworks.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworks.java new file mode 100644 index 000000000000..4edd2930d76a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/AttachedDataNetworks.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AttachedDataNetworks. */ +public interface AttachedDataNetworks { + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName); + + /** + * Deletes the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context); + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network. + */ + AttachedDataNetwork get( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName); + + /** + * Gets information about the specified attached data network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param attachedDataNetworkName The name of the attached data network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String packetCoreControlPlaneName, + String packetCoreDataPlaneName, + String attachedDataNetworkName, + Context context); + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Gets all the data networks associated with a packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the data networks associated with a packet core data plane as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByPacketCoreDataPlane( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Gets information about the specified attached data network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response}. + */ + AttachedDataNetwork getById(String id); + + /** + * Gets information about the specified attached data network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified attached data network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified attached data network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified attached data network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AttachedDataNetwork resource. + * + * @param name resource name. + * @return the first stage of the new AttachedDataNetwork definition. + */ + AttachedDataNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ConfigurationState.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ConfigurationState.java new file mode 100644 index 000000000000..83c97ce431cf --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ConfigurationState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigurationState. */ +public final class ConfigurationState extends ExpandableStringEnum { + /** Static value Incomplete for ConfigurationState. */ + public static final ConfigurationState INCOMPLETE = fromString("Incomplete"); + + /** Static value Complete for ConfigurationState. */ + public static final ConfigurationState COMPLETE = fromString("Complete"); + + /** + * Creates or finds a ConfigurationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationState. + */ + @JsonCreator + public static ConfigurationState fromString(String name) { + return fromString(name, ConfigurationState.class); + } + + /** @return known ConfigurationState values. */ + public static Collection values() { + return values(ConfigurationState.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CoreNetworkType.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CoreNetworkType.java new file mode 100644 index 000000000000..2a6d8b75d313 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CoreNetworkType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CoreNetworkType. */ +public final class CoreNetworkType extends ExpandableStringEnum { + /** Static value 5GC for CoreNetworkType. */ + public static final CoreNetworkType FIVE_GC = fromString("5GC"); + + /** Static value EPC for CoreNetworkType. */ + public static final CoreNetworkType EPC = fromString("EPC"); + + /** + * Creates or finds a CoreNetworkType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CoreNetworkType. + */ + @JsonCreator + public static CoreNetworkType fromString(String name) { + return fromString(name, CoreNetworkType.class); + } + + /** @return known CoreNetworkType values. */ + public static Collection values() { + return values(CoreNetworkType.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CustomLocationResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CustomLocationResourceId.java new file mode 100644 index 000000000000..94deb4b3b09e --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/CustomLocationResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to an Azure ARC custom location resource. */ +@Fluent +public final class CustomLocationResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomLocationResourceId.class); + + /* + * Azure ARC custom location resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Azure ARC custom location resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Azure ARC custom location resource ID. + * + * @param id the id value to set. + * @return the CustomLocationResourceId object itself. + */ + public CustomLocationResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model CustomLocationResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetwork.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetwork.java new file mode 100644 index 000000000000..eee8c51a88a6 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetwork.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import java.util.Map; + +/** An immutable client-side representation of DataNetwork. */ +public interface DataNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the data network resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the description property: An optional description for this data network. + * + * @return the description value. + */ + String description(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner object. + * + * @return the inner object. + */ + DataNetworkInner innerModel(); + + /** The entirety of the DataNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The DataNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the DataNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the DataNetwork definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, mobileNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @return the next definition stage. + */ + WithCreate withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName); + } + /** + * The stage of the DataNetwork definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataNetwork create(Context context); + } + /** The stage of the DataNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DataNetwork definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: An optional description for this data network.. + * + * @param description An optional description for this data network. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + /** + * Begins update for the DataNetwork resource. + * + * @return the stage of resource update. + */ + DataNetwork.Update update(); + + /** The template for DataNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataNetwork apply(Context context); + } + /** The DataNetwork update stages. */ + interface UpdateStages { + /** The stage of the DataNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataNetwork refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkConfiguration.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkConfiguration.java new file mode 100644 index 000000000000..c92af2a1f5ac --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkConfiguration.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Settings controlling Data Network use. */ +@Fluent +public final class DataNetworkConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworkConfiguration.class); + + /* + * A reference to the Data Network that these settings apply to + */ + @JsonProperty(value = "dataNetwork", required = true) + private DataNetworkResourceId dataNetwork; + + /* + * Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU + * session. See 3GPP TS23.501 section 5.7.2.6 for a full description of the + * Session-AMBR. + */ + @JsonProperty(value = "sessionAmbr", required = true) + private Ambr sessionAmbr; + + /* + * Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific + * QoS forwarding treatment to be provided to a flow. This must not be a + * standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. The + * illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, + * 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full + * description of the 5Qi parameter, and table 5.7.4-1 for the definition + * of which are the GBR 5QI values. + */ + @JsonProperty(value = "5qi") + private Integer fiveQi; + + /* + * Default QoS Flow allocation and retention priority (ARP) level. Flows + * with higher priority preempt flows with lower priority, if the settings + * of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is + * the highest level of priority. If this field is not specified then `5qi` + * is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a + * full description of the ARP parameters. + */ + @JsonProperty(value = "allocationAndRetentionPriorityLevel") + private Integer allocationAndRetentionPriorityLevel; + + /* + * Default QoS Flow preemption capability. The Preemption Capability of a + * QoS Flow controls whether it can preempt another QoS Flow with a lower + * priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description + * of the ARP parameters. + */ + @JsonProperty(value = "preemptionCapability") + private PreemptionCapability preemptionCapability; + + /* + * Default QoS Flow preemption vulnerability. The Preemption Vulnerability + * of a QoS Flow controls whether it can be preempted by QoS Flow with a + * higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full + * description of the ARP parameters. + */ + @JsonProperty(value = "preemptionVulnerability") + private PreemptionVulnerability preemptionVulnerability; + + /* + * The default PDU session type, which is used if the UE does not request a + * specific session type. + */ + @JsonProperty(value = "defaultSessionType") + private PduSessionType defaultSessionType; + + /* + * Allowed session types in addition to the default session type. Must not + * duplicate the default session type. + */ + @JsonProperty(value = "additionalAllowedSessionTypes") + private List additionalAllowedSessionTypes; + + /* + * List of Services that can be used as part of this Sim Policy. The list + * must not contain duplicate items and must contain at least one item. + */ + @JsonProperty(value = "allowedServices", required = true) + private List allowedServices; + + /** + * Get the dataNetwork property: A reference to the Data Network that these settings apply to. + * + * @return the dataNetwork value. + */ + public DataNetworkResourceId dataNetwork() { + return this.dataNetwork; + } + + /** + * Set the dataNetwork property: A reference to the Data Network that these settings apply to. + * + * @param dataNetwork the dataNetwork value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withDataNetwork(DataNetworkResourceId dataNetwork) { + this.dataNetwork = dataNetwork; + return this; + } + + /** + * Get the sessionAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU session. See + * 3GPP TS23.501 section 5.7.2.6 for a full description of the Session-AMBR. + * + * @return the sessionAmbr value. + */ + public Ambr sessionAmbr() { + return this.sessionAmbr; + } + + /** + * Set the sessionAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU session. See + * 3GPP TS23.501 section 5.7.2.6 for a full description of the Session-AMBR. + * + * @param sessionAmbr the sessionAmbr value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withSessionAmbr(Ambr sessionAmbr) { + this.sessionAmbr = sessionAmbr; + return this; + } + + /** + * Get the fiveQi property: Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding + * treatment to be provided to a flow. This must not be a standardized 5QI value selecting a GBR (Guaranteed Bit + * Rate) QoS. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. + * See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for the + * definition of which are the GBR 5QI values. + * + * @return the fiveQi value. + */ + public Integer fiveQi() { + return this.fiveQi; + } + + /** + * Set the fiveQi property: Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding + * treatment to be provided to a flow. This must not be a standardized 5QI value selecting a GBR (Guaranteed Bit + * Rate) QoS. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. + * See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for the + * definition of which are the GBR 5QI values. + * + * @param fiveQi the fiveQi value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withFiveQi(Integer fiveQi) { + this.fiveQi = fiveQi; + return this; + } + + /** + * Get the allocationAndRetentionPriorityLevel property: Default QoS Flow allocation and retention priority (ARP) + * level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` + * and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then + * `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP + * parameters. + * + * @return the allocationAndRetentionPriorityLevel value. + */ + public Integer allocationAndRetentionPriorityLevel() { + return this.allocationAndRetentionPriorityLevel; + } + + /** + * Set the allocationAndRetentionPriorityLevel property: Default QoS Flow allocation and retention priority (ARP) + * level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` + * and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then + * `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP + * parameters. + * + * @param allocationAndRetentionPriorityLevel the allocationAndRetentionPriorityLevel value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withAllocationAndRetentionPriorityLevel( + Integer allocationAndRetentionPriorityLevel) { + this.allocationAndRetentionPriorityLevel = allocationAndRetentionPriorityLevel; + return this; + } + + /** + * Get the preemptionCapability property: Default QoS Flow preemption capability. The Preemption Capability of a QoS + * Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section + * 5.7.2.2 for a full description of the ARP parameters. + * + * @return the preemptionCapability value. + */ + public PreemptionCapability preemptionCapability() { + return this.preemptionCapability; + } + + /** + * Set the preemptionCapability property: Default QoS Flow preemption capability. The Preemption Capability of a QoS + * Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section + * 5.7.2.2 for a full description of the ARP parameters. + * + * @param preemptionCapability the preemptionCapability value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withPreemptionCapability(PreemptionCapability preemptionCapability) { + this.preemptionCapability = preemptionCapability; + return this; + } + + /** + * Get the preemptionVulnerability property: Default QoS Flow preemption vulnerability. The Preemption Vulnerability + * of a QoS Flow controls whether it can be preempted by QoS Flow with a higher priority level. See 3GPP TS23.501 + * section 5.7.2.2 for a full description of the ARP parameters. + * + * @return the preemptionVulnerability value. + */ + public PreemptionVulnerability preemptionVulnerability() { + return this.preemptionVulnerability; + } + + /** + * Set the preemptionVulnerability property: Default QoS Flow preemption vulnerability. The Preemption Vulnerability + * of a QoS Flow controls whether it can be preempted by QoS Flow with a higher priority level. See 3GPP TS23.501 + * section 5.7.2.2 for a full description of the ARP parameters. + * + * @param preemptionVulnerability the preemptionVulnerability value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withPreemptionVulnerability(PreemptionVulnerability preemptionVulnerability) { + this.preemptionVulnerability = preemptionVulnerability; + return this; + } + + /** + * Get the defaultSessionType property: The default PDU session type, which is used if the UE does not request a + * specific session type. + * + * @return the defaultSessionType value. + */ + public PduSessionType defaultSessionType() { + return this.defaultSessionType; + } + + /** + * Set the defaultSessionType property: The default PDU session type, which is used if the UE does not request a + * specific session type. + * + * @param defaultSessionType the defaultSessionType value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withDefaultSessionType(PduSessionType defaultSessionType) { + this.defaultSessionType = defaultSessionType; + return this; + } + + /** + * Get the additionalAllowedSessionTypes property: Allowed session types in addition to the default session type. + * Must not duplicate the default session type. + * + * @return the additionalAllowedSessionTypes value. + */ + public List additionalAllowedSessionTypes() { + return this.additionalAllowedSessionTypes; + } + + /** + * Set the additionalAllowedSessionTypes property: Allowed session types in addition to the default session type. + * Must not duplicate the default session type. + * + * @param additionalAllowedSessionTypes the additionalAllowedSessionTypes value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withAdditionalAllowedSessionTypes( + List additionalAllowedSessionTypes) { + this.additionalAllowedSessionTypes = additionalAllowedSessionTypes; + return this; + } + + /** + * Get the allowedServices property: List of Services that can be used as part of this Sim Policy. The list must not + * contain duplicate items and must contain at least one item. + * + * @return the allowedServices value. + */ + public List allowedServices() { + return this.allowedServices; + } + + /** + * Set the allowedServices property: List of Services that can be used as part of this Sim Policy. The list must not + * contain duplicate items and must contain at least one item. + * + * @param allowedServices the allowedServices value to set. + * @return the DataNetworkConfiguration object itself. + */ + public DataNetworkConfiguration withAllowedServices(List allowedServices) { + this.allowedServices = allowedServices; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataNetwork() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataNetwork in model DataNetworkConfiguration")); + } else { + dataNetwork().validate(); + } + if (sessionAmbr() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sessionAmbr in model DataNetworkConfiguration")); + } else { + sessionAmbr().validate(); + } + if (allowedServices() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property allowedServices in model DataNetworkConfiguration")); + } else { + allowedServices().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkListResult.java new file mode 100644 index 000000000000..1ec316cf1284 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.DataNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for data network API service call. */ +@Fluent +public final class DataNetworkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworkListResult.class); + + /* + * A list of data networks in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of data networks in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of data networks in a resource group. + * + * @param value the value value to set. + * @return the DataNetworkListResult object itself. + */ + public DataNetworkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkResourceId.java new file mode 100644 index 000000000000..22623abb7fd1 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworkResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a Data Network resource. */ +@Fluent +public final class DataNetworkResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataNetworkResourceId.class); + + /* + * Data Network resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Data Network resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Data Network resource ID. + * + * @param id the id value to set. + * @return the DataNetworkResourceId object itself. + */ + public DataNetworkResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model DataNetworkResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworks.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworks.java new file mode 100644 index 000000000000..8c575ddc4807 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/DataNetworks.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataNetworks. */ +public interface DataNetworks { + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork. + */ + DataNetwork get(String resourceGroupName, String mobileNetworkName, String dataNetworkName); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param dataNetworkName The name of the mobile network dataNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String dataNetworkName, Context context); + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all dataNetworks in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for data network API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response}. + */ + DataNetwork getById(String id); + + /** + * Gets information about the specified mobile network dataNetwork. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network dataNetwork along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified mobile network dataNetwork. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataNetwork resource. + * + * @param name resource name. + * @return the first stage of the new DataNetwork definition. + */ + DataNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/InterfaceProperties.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/InterfaceProperties.java new file mode 100644 index 000000000000..db8e018d4702 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/InterfaceProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Interface properties. */ +@Fluent +public final class InterfaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InterfaceProperties.class); + + /* + * The logical name for this interface. This should match one of the + * interfaces configured on your Azure Stack Edge machine. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The logical name for this interface. This should match one of the interfaces configured on + * your Azure Stack Edge machine. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The logical name for this interface. This should match one of the interfaces configured on + * your Azure Stack Edge machine. + * + * @param name the name value to set. + * @return the InterfaceProperties object itself. + */ + public InterfaceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model InterfaceProperties")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetwork.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetwork.java new file mode 100644 index 000000000000..137857832f9b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetwork.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import java.util.Map; + +/** An immutable client-side representation of MobileNetwork. */ +public interface MobileNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the mobile network resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the publicLandMobileNetworkIdentifier property: The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 + * and 999-999 can be used on internal private networks. + * + * @return the publicLandMobileNetworkIdentifier value. + */ + PlmnId publicLandMobileNetworkIdentifier(); + + /** + * Gets the serviceKey property: The mobile network resource identifier. + * + * @return the serviceKey value. + */ + String serviceKey(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner object. + * + * @return the inner object. + */ + MobileNetworkInner innerModel(); + + /** The entirety of the MobileNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithPublicLandMobileNetworkIdentifier, + DefinitionStages.WithCreate { + } + /** The MobileNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the MobileNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the MobileNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the MobileNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithPublicLandMobileNetworkIdentifier withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the MobileNetwork definition allowing to specify publicLandMobileNetworkIdentifier. */ + interface WithPublicLandMobileNetworkIdentifier { + /** + * Specifies the publicLandMobileNetworkIdentifier property: The unique public land mobile network + * identifier for the network. This is made up of the Mobile Country Code and Mobile Network Code, as + * defined in https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and + * the values 999-99 and 999-999 can be used on internal private networks.. + * + * @param publicLandMobileNetworkIdentifier The unique public land mobile network identifier for the + * network. This is made up of the Mobile Country Code and Mobile Network Code, as defined in + * https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the + * values 999-99 and 999-999 can be used on internal private networks. + * @return the next definition stage. + */ + WithCreate withPublicLandMobileNetworkIdentifier(PlmnId publicLandMobileNetworkIdentifier); + } + /** + * The stage of the MobileNetwork definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + MobileNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MobileNetwork create(Context context); + } + /** The stage of the MobileNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the MobileNetwork resource. + * + * @return the stage of resource update. + */ + MobileNetwork.Update update(); + + /** The template for MobileNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MobileNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MobileNetwork apply(Context context); + } + /** The MobileNetwork update stages. */ + interface UpdateStages { + /** The stage of the MobileNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MobileNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MobileNetwork refresh(Context context); + + /** + * List sim ids under a mobile network. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + SimIdListResult listSimIds(); + + /** + * List sim ids under a mobile network. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + SimIdListResult listSimIds(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkListResult.java new file mode 100644 index 000000000000..968061db8bb9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.MobileNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for mobile networks API service call. */ +@Fluent +public final class MobileNetworkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobileNetworkListResult.class); + + /* + * A list of mobile networks in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of mobile networks in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of mobile networks in a resource group. + * + * @param value the value value to set. + * @return the MobileNetworkListResult object itself. + */ + public MobileNetworkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkResourceId.java new file mode 100644 index 000000000000..7fdffdd5ebbe --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworkResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a Mobile Network resource. */ +@Fluent +public final class MobileNetworkResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MobileNetworkResourceId.class); + + /* + * Mobile Network resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Mobile Network resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Mobile Network resource ID. + * + * @param id the id value to set. + * @return the MobileNetworkResourceId object itself. + */ + public MobileNetworkResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model MobileNetworkResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworks.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworks.java new file mode 100644 index 000000000000..2fde8a048182 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/MobileNetworks.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MobileNetworks. */ +public interface MobileNetworks { + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String mobileNetworkName); + + /** + * Deletes the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network. + */ + MobileNetwork getByResourceGroup(String resourceGroupName, String mobileNetworkName); + + /** + * Gets information about the specified mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Lists all the mobile networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the mobile networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the mobile networks in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for mobile networks API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + SimIdListResult listSimIds(String resourceGroupName, String mobileNetworkName); + + /** + * List sim ids under a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list sim ids API service call. + */ + SimIdListResult listSimIds(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response}. + */ + MobileNetwork getById(String id); + + /** + * Gets information about the specified mobile network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified mobile network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified mobile network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MobileNetwork resource. + * + * @param name resource name. + * @return the first stage of the new MobileNetwork definition. + */ + MobileNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptConfiguration.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptConfiguration.java new file mode 100644 index 000000000000..e5a675fcf95a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptConfiguration.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Network Address and Port Translation settings to use for the attached data network. */ +@Fluent +public final class NaptConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NaptConfiguration.class); + + /* + * Whether NAPT is enabled for connections to this attachedDataNetwork. + */ + @JsonProperty(value = "enabled") + private NaptEnabled enabled; + + /* + * Range of port numbers to use as translated ports on each translated + * address. + * If not specified and NAPT is enabled, this range defaults to 1,024 - + * 65,535. (Ports under 1,024 should not be used because these are special + * purpose ports reserved by IANA.) + */ + @JsonProperty(value = "portRange") + private PortRange portRange; + + /* + * The minimum time (in seconds) that will pass before a port that was used + * by a closed pinhole can be recycled for use by another pinhole. All hold + * times must be minimum 1 second. + */ + @JsonProperty(value = "portReuseHoldTime") + private PortReuseHoldTimes portReuseHoldTime; + + /* + * Maximum number of UDP and TCP pinholes that can be open simultaneously + * on the core interface. + */ + @JsonProperty(value = "pinholeLimits") + private Integer pinholeLimits; + + /* + * Expiry times of inactive NAPT pinholes, in seconds. All timers must be + * at least 1 second. + */ + @JsonProperty(value = "pinholeTimeouts") + private PinholeTimeouts pinholeTimeouts; + + /** + * Get the enabled property: Whether NAPT is enabled for connections to this attachedDataNetwork. + * + * @return the enabled value. + */ + public NaptEnabled enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether NAPT is enabled for connections to this attachedDataNetwork. + * + * @param enabled the enabled value to set. + * @return the NaptConfiguration object itself. + */ + public NaptConfiguration withEnabled(NaptEnabled enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the portRange property: Range of port numbers to use as translated ports on each translated address. If not + * specified and NAPT is enabled, this range defaults to 1,024 - 65,535. (Ports under 1,024 should not be used + * because these are special purpose ports reserved by IANA.). + * + * @return the portRange value. + */ + public PortRange portRange() { + return this.portRange; + } + + /** + * Set the portRange property: Range of port numbers to use as translated ports on each translated address. If not + * specified and NAPT is enabled, this range defaults to 1,024 - 65,535. (Ports under 1,024 should not be used + * because these are special purpose ports reserved by IANA.). + * + * @param portRange the portRange value to set. + * @return the NaptConfiguration object itself. + */ + public NaptConfiguration withPortRange(PortRange portRange) { + this.portRange = portRange; + return this; + } + + /** + * Get the portReuseHoldTime property: The minimum time (in seconds) that will pass before a port that was used by a + * closed pinhole can be recycled for use by another pinhole. All hold times must be minimum 1 second. + * + * @return the portReuseHoldTime value. + */ + public PortReuseHoldTimes portReuseHoldTime() { + return this.portReuseHoldTime; + } + + /** + * Set the portReuseHoldTime property: The minimum time (in seconds) that will pass before a port that was used by a + * closed pinhole can be recycled for use by another pinhole. All hold times must be minimum 1 second. + * + * @param portReuseHoldTime the portReuseHoldTime value to set. + * @return the NaptConfiguration object itself. + */ + public NaptConfiguration withPortReuseHoldTime(PortReuseHoldTimes portReuseHoldTime) { + this.portReuseHoldTime = portReuseHoldTime; + return this; + } + + /** + * Get the pinholeLimits property: Maximum number of UDP and TCP pinholes that can be open simultaneously on the + * core interface. + * + * @return the pinholeLimits value. + */ + public Integer pinholeLimits() { + return this.pinholeLimits; + } + + /** + * Set the pinholeLimits property: Maximum number of UDP and TCP pinholes that can be open simultaneously on the + * core interface. + * + * @param pinholeLimits the pinholeLimits value to set. + * @return the NaptConfiguration object itself. + */ + public NaptConfiguration withPinholeLimits(Integer pinholeLimits) { + this.pinholeLimits = pinholeLimits; + return this; + } + + /** + * Get the pinholeTimeouts property: Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least + * 1 second. + * + * @return the pinholeTimeouts value. + */ + public PinholeTimeouts pinholeTimeouts() { + return this.pinholeTimeouts; + } + + /** + * Set the pinholeTimeouts property: Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least + * 1 second. + * + * @param pinholeTimeouts the pinholeTimeouts value to set. + * @return the NaptConfiguration object itself. + */ + public NaptConfiguration withPinholeTimeouts(PinholeTimeouts pinholeTimeouts) { + this.pinholeTimeouts = pinholeTimeouts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (portRange() != null) { + portRange().validate(); + } + if (portReuseHoldTime() != null) { + portReuseHoldTime().validate(); + } + if (pinholeTimeouts() != null) { + pinholeTimeouts().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptEnabled.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptEnabled.java new file mode 100644 index 000000000000..b4e56304f747 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/NaptEnabled.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NaptEnabled. */ +public final class NaptEnabled extends ExpandableStringEnum { + /** Static value Enabled for NaptEnabled. */ + public static final NaptEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for NaptEnabled. */ + public static final NaptEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a NaptEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding NaptEnabled. + */ + @JsonCreator + public static NaptEnabled fromString(String name) { + return fromString(name, NaptEnabled.class); + } + + /** @return known NaptEnabled values. */ + public static Collection values() { + return values(NaptEnabled.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operation.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operation.java new file mode 100644 index 000000000000..4820611cffdb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operation.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationDisplay.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationDisplay.java new file mode 100644 index 000000000000..e3930e93edd9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationDisplay.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft.MobileNetwork + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed: Registration definition, + * registration assignment etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft.MobileNetwork. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft.MobileNetwork. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed: Registration definition, registration + * assignment etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed: Registration definition, registration + * assignment etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: Read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationList.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationList.java new file mode 100644 index 000000000000..a7aeb63c0513 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/OperationList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of the operations. */ +@Immutable +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * List of Microsoft.MobileNetwork operations. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of Microsoft.MobileNetwork operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operations.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operations.java new file mode 100644 index 000000000000..17f569e98df7 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of the operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of the operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlane.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlane.java new file mode 100644 index 000000000000..21ea4217121d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlane.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import java.util.Map; + +/** An immutable client-side representation of PacketCoreControlPlane. */ +public interface PacketCoreControlPlane { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the packet core control plane resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @return the mobileNetwork value. + */ + MobileNetworkResourceId mobileNetwork(); + + /** + * Gets the customLocation property: Azure ARC custom location where the packet core is deployed. + * + * @return the customLocation value. + */ + CustomLocationResourceId customLocation(); + + /** + * Gets the coreNetworkTechnology property: The core network technology generation. + * + * @return the coreNetworkTechnology value. + */ + CoreNetworkType coreNetworkTechnology(); + + /** + * Gets the version property: The version of the packet core software that is deployed. + * + * @return the version value. + */ + String version(); + + /** + * Gets the controlPlaneAccessInterface property: The control plane interface on the access network. In 5G networks + * this is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * + * @return the controlPlaneAccessInterface value. + */ + InterfaceProperties controlPlaneAccessInterface(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner object. + * + * @return the inner object. + */ + PacketCoreControlPlaneInner innerModel(); + + /** The entirety of the PacketCoreControlPlane definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithMobileNetwork, + DefinitionStages.WithControlPlaneAccessInterface, + DefinitionStages.WithCreate { + } + /** The PacketCoreControlPlane definition stages. */ + interface DefinitionStages { + /** The first stage of the PacketCoreControlPlane definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PacketCoreControlPlane definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithMobileNetwork withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify mobileNetwork. */ + interface WithMobileNetwork { + /** + * Specifies the mobileNetwork property: Mobile network that this packet core control plane belongs to. + * + * @param mobileNetwork Mobile network that this packet core control plane belongs to. + * @return the next definition stage. + */ + WithControlPlaneAccessInterface withMobileNetwork(MobileNetworkResourceId mobileNetwork); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify controlPlaneAccessInterface. */ + interface WithControlPlaneAccessInterface { + /** + * Specifies the controlPlaneAccessInterface property: The control plane interface on the access network. In + * 5G networks this is called as N2 interface whereas in 4G networks this is called as S1-MME interface.. + * + * @param controlPlaneAccessInterface The control plane interface on the access network. In 5G networks this + * is called as N2 interface whereas in 4G networks this is called as S1-MME interface. + * @return the next definition stage. + */ + WithCreate withControlPlaneAccessInterface(InterfaceProperties controlPlaneAccessInterface); + } + /** + * The stage of the PacketCoreControlPlane definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithCustomLocation, + DefinitionStages.WithCoreNetworkTechnology, + DefinitionStages.WithVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + PacketCoreControlPlane create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PacketCoreControlPlane create(Context context); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify customLocation. */ + interface WithCustomLocation { + /** + * Specifies the customLocation property: Azure ARC custom location where the packet core is deployed.. + * + * @param customLocation Azure ARC custom location where the packet core is deployed. + * @return the next definition stage. + */ + WithCreate withCustomLocation(CustomLocationResourceId customLocation); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify coreNetworkTechnology. */ + interface WithCoreNetworkTechnology { + /** + * Specifies the coreNetworkTechnology property: The core network technology generation.. + * + * @param coreNetworkTechnology The core network technology generation. + * @return the next definition stage. + */ + WithCreate withCoreNetworkTechnology(CoreNetworkType coreNetworkTechnology); + } + /** The stage of the PacketCoreControlPlane definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: The version of the packet core software that is deployed.. + * + * @param version The version of the packet core software that is deployed. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + } + /** + * Begins update for the PacketCoreControlPlane resource. + * + * @return the stage of resource update. + */ + PacketCoreControlPlane.Update update(); + + /** The template for PacketCoreControlPlane update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PacketCoreControlPlane apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PacketCoreControlPlane apply(Context context); + } + /** The PacketCoreControlPlane update stages. */ + interface UpdateStages { + /** The stage of the PacketCoreControlPlane update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PacketCoreControlPlane refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PacketCoreControlPlane refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlaneListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlaneListResult.java new file mode 100644 index 000000000000..d7c742bc3aba --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlaneListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreControlPlaneInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for packet core control planes API service call. */ +@Fluent +public final class PacketCoreControlPlaneListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreControlPlaneListResult.class); + + /* + * A list of packet core control planes in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of packet core control planes in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of packet core control planes in a resource group. + * + * @param value the value value to set. + * @return the PacketCoreControlPlaneListResult object itself. + */ + public PacketCoreControlPlaneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlanes.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlanes.java new file mode 100644 index 000000000000..c915532d83af --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreControlPlanes.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PacketCoreControlPlanes. */ +public interface PacketCoreControlPlanes { + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Deletes the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane. + */ + PacketCoreControlPlane getByResourceGroup(String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Gets information about the specified packet core control plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the packetCoreControlPlanes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the packetCoreControlPlanes in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core control planes API service call as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified packet core control plane. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response}. + */ + PacketCoreControlPlane getById(String id); + + /** + * Gets information about the specified packet core control plane. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core control plane along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified packet core control plane. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified packet core control plane. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PacketCoreControlPlane resource. + * + * @param name resource name. + * @return the first stage of the new PacketCoreControlPlane definition. + */ + PacketCoreControlPlane.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlane.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlane.java new file mode 100644 index 000000000000..2fbbb332fcbb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlane.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import java.util.Map; + +/** An immutable client-side representation of PacketCoreDataPlane. */ +public interface PacketCoreDataPlane { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the packet core data plane resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the userPlaneAccessInterface property: The user plane interface on the access network. In 5G networks this + * is called as N3 interface whereas in 4G networks this is called the S1-U interface. + * + * @return the userPlaneAccessInterface value. + */ + InterfaceProperties userPlaneAccessInterface(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner object. + * + * @return the inner object. + */ + PacketCoreDataPlaneInner innerModel(); + + /** The entirety of the PacketCoreDataPlane definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithUserPlaneAccessInterface, + DefinitionStages.WithCreate { + } + /** The PacketCoreDataPlane definition stages. */ + interface DefinitionStages { + /** The first stage of the PacketCoreDataPlane definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PacketCoreDataPlane definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the PacketCoreDataPlane definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, packetCoreControlPlaneName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @return the next definition stage. + */ + WithUserPlaneAccessInterface withExistingPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName); + } + /** The stage of the PacketCoreDataPlane definition allowing to specify userPlaneAccessInterface. */ + interface WithUserPlaneAccessInterface { + /** + * Specifies the userPlaneAccessInterface property: The user plane interface on the access network. In 5G + * networks this is called as N3 interface whereas in 4G networks this is called the S1-U interface.. + * + * @param userPlaneAccessInterface The user plane interface on the access network. In 5G networks this is + * called as N3 interface whereas in 4G networks this is called the S1-U interface. + * @return the next definition stage. + */ + WithCreate withUserPlaneAccessInterface(InterfaceProperties userPlaneAccessInterface); + } + /** + * The stage of the PacketCoreDataPlane definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + PacketCoreDataPlane create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PacketCoreDataPlane create(Context context); + } + /** The stage of the PacketCoreDataPlane definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the PacketCoreDataPlane resource. + * + * @return the stage of resource update. + */ + PacketCoreDataPlane.Update update(); + + /** The template for PacketCoreDataPlane update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PacketCoreDataPlane apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PacketCoreDataPlane apply(Context context); + } + /** The PacketCoreDataPlane update stages. */ + interface UpdateStages { + /** The stage of the PacketCoreDataPlane update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PacketCoreDataPlane refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PacketCoreDataPlane refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlaneListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlaneListResult.java new file mode 100644 index 000000000000..5f109f98e6e9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlaneListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.PacketCoreDataPlaneInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for packet core data planes API service call. */ +@Fluent +public final class PacketCoreDataPlaneListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCoreDataPlaneListResult.class); + + /* + * A list of packet core data planes in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of packet core data planes in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of packet core data planes in a resource group. + * + * @param value the value value to set. + * @return the PacketCoreDataPlaneListResult object itself. + */ + public PacketCoreDataPlaneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlanes.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlanes.java new file mode 100644 index 000000000000..a2932d11b513 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PacketCoreDataPlanes.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PacketCoreDataPlanes. */ +public interface PacketCoreDataPlanes { + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Deletes the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane. + */ + PacketCoreDataPlane get( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName); + + /** + * Gets information about the specified packet core data plane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param packetCoreDataPlaneName The name of the packet core data plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String packetCoreControlPlaneName, String packetCoreDataPlaneName, Context context); + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName); + + /** + * Lists all the packetCoreDataPlanes associated with a packetCoreControlPlane. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param packetCoreControlPlaneName The name of the packet core control plane. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for packet core data planes API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPacketCoreControlPlane( + String resourceGroupName, String packetCoreControlPlaneName, Context context); + + /** + * Gets information about the specified packet core data plane. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response}. + */ + PacketCoreDataPlane getById(String id); + + /** + * Gets information about the specified packet core data plane. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified packet core data plane along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified packet core data plane. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified packet core data plane. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PacketCoreDataPlane resource. + * + * @param name resource name. + * @return the first stage of the new PacketCoreDataPlane definition. + */ + PacketCoreDataPlane.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleConfiguration.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleConfiguration.java new file mode 100644 index 000000000000..15d60d1caf93 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleConfiguration.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PCC rule configuration. */ +@Fluent +public final class PccRuleConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PccRuleConfiguration.class); + + /* + * The name of the rule. This must be unique within the parent Service. You + * must not use any of the following reserved strings - `default`, + * `requested` or `service`. + */ + @JsonProperty(value = "ruleName", required = true) + private String ruleName; + + /* + * A precedence value that is used to decide between PCC Rules when + * identifying the QoS values to use for a particular Sim. A lower value + * means a higher priority. This value should be unique among all PCC Rules + * configured in the Mobile Network. + */ + @JsonProperty(value = "rulePrecedence", required = true) + private int rulePrecedence; + + /* + * The QoS policy to use for packets matching this rule. If this field is + * null then the Service will define the QoS settings. + */ + @JsonProperty(value = "ruleQosPolicy") + private PccRuleQosPolicy ruleQosPolicy; + + /* + * Determines whether flows that match this PCC Rule are permitted. + */ + @JsonProperty(value = "trafficControl") + private TrafficControlPermission trafficControl; + + /* + * The set of service data flow templates to use for this PCC Rule. + */ + @JsonProperty(value = "serviceDataFlowTemplates", required = true) + private List serviceDataFlowTemplates; + + /** + * Get the ruleName property: The name of the rule. This must be unique within the parent Service. You must not use + * any of the following reserved strings - `default`, `requested` or `service`. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: The name of the rule. This must be unique within the parent Service. You must not use + * any of the following reserved strings - `default`, `requested` or `service`. + * + * @param ruleName the ruleName value to set. + * @return the PccRuleConfiguration object itself. + */ + public PccRuleConfiguration withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the rulePrecedence property: A precedence value that is used to decide between PCC Rules when identifying the + * QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique among + * all PCC Rules configured in the Mobile Network. + * + * @return the rulePrecedence value. + */ + public int rulePrecedence() { + return this.rulePrecedence; + } + + /** + * Set the rulePrecedence property: A precedence value that is used to decide between PCC Rules when identifying the + * QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique among + * all PCC Rules configured in the Mobile Network. + * + * @param rulePrecedence the rulePrecedence value to set. + * @return the PccRuleConfiguration object itself. + */ + public PccRuleConfiguration withRulePrecedence(int rulePrecedence) { + this.rulePrecedence = rulePrecedence; + return this; + } + + /** + * Get the ruleQosPolicy property: The QoS policy to use for packets matching this rule. If this field is null then + * the Service will define the QoS settings. + * + * @return the ruleQosPolicy value. + */ + public PccRuleQosPolicy ruleQosPolicy() { + return this.ruleQosPolicy; + } + + /** + * Set the ruleQosPolicy property: The QoS policy to use for packets matching this rule. If this field is null then + * the Service will define the QoS settings. + * + * @param ruleQosPolicy the ruleQosPolicy value to set. + * @return the PccRuleConfiguration object itself. + */ + public PccRuleConfiguration withRuleQosPolicy(PccRuleQosPolicy ruleQosPolicy) { + this.ruleQosPolicy = ruleQosPolicy; + return this; + } + + /** + * Get the trafficControl property: Determines whether flows that match this PCC Rule are permitted. + * + * @return the trafficControl value. + */ + public TrafficControlPermission trafficControl() { + return this.trafficControl; + } + + /** + * Set the trafficControl property: Determines whether flows that match this PCC Rule are permitted. + * + * @param trafficControl the trafficControl value to set. + * @return the PccRuleConfiguration object itself. + */ + public PccRuleConfiguration withTrafficControl(TrafficControlPermission trafficControl) { + this.trafficControl = trafficControl; + return this; + } + + /** + * Get the serviceDataFlowTemplates property: The set of service data flow templates to use for this PCC Rule. + * + * @return the serviceDataFlowTemplates value. + */ + public List serviceDataFlowTemplates() { + return this.serviceDataFlowTemplates; + } + + /** + * Set the serviceDataFlowTemplates property: The set of service data flow templates to use for this PCC Rule. + * + * @param serviceDataFlowTemplates the serviceDataFlowTemplates value to set. + * @return the PccRuleConfiguration object itself. + */ + public PccRuleConfiguration withServiceDataFlowTemplates(List serviceDataFlowTemplates) { + this.serviceDataFlowTemplates = serviceDataFlowTemplates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleName in model PccRuleConfiguration")); + } + if (ruleQosPolicy() != null) { + ruleQosPolicy().validate(); + } + if (serviceDataFlowTemplates() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceDataFlowTemplates in model PccRuleConfiguration")); + } else { + serviceDataFlowTemplates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleQosPolicy.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleQosPolicy.java new file mode 100644 index 000000000000..96ff62ee0288 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PccRuleQosPolicy.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PCC rule QoS policy. */ +@Fluent +public final class PccRuleQosPolicy extends QosPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PccRuleQosPolicy.class); + + /* + * The Guaranteed Bit Rate (GBR) for all service data flows that use this + * PCC Rule. This is an optional setting. If you do not provide a value, + * there will be no GBR set for the PCC Rule that uses this QoS definition. + */ + @JsonProperty(value = "guaranteedBitRate") + private Ambr guaranteedBitRate; + + /** + * Get the guaranteedBitRate property: The Guaranteed Bit Rate (GBR) for all service data flows that use this PCC + * Rule. This is an optional setting. If you do not provide a value, there will be no GBR set for the PCC Rule that + * uses this QoS definition. + * + * @return the guaranteedBitRate value. + */ + public Ambr guaranteedBitRate() { + return this.guaranteedBitRate; + } + + /** + * Set the guaranteedBitRate property: The Guaranteed Bit Rate (GBR) for all service data flows that use this PCC + * Rule. This is an optional setting. If you do not provide a value, there will be no GBR set for the PCC Rule that + * uses this QoS definition. + * + * @param guaranteedBitRate the guaranteedBitRate value to set. + * @return the PccRuleQosPolicy object itself. + */ + public PccRuleQosPolicy withGuaranteedBitRate(Ambr guaranteedBitRate) { + this.guaranteedBitRate = guaranteedBitRate; + return this; + } + + /** {@inheritDoc} */ + @Override + public PccRuleQosPolicy withFiveQi(Integer fiveQi) { + super.withFiveQi(fiveQi); + return this; + } + + /** {@inheritDoc} */ + @Override + public PccRuleQosPolicy withAllocationAndRetentionPriorityLevel(Integer allocationAndRetentionPriorityLevel) { + super.withAllocationAndRetentionPriorityLevel(allocationAndRetentionPriorityLevel); + return this; + } + + /** {@inheritDoc} */ + @Override + public PccRuleQosPolicy withPreemptionCapability(PreemptionCapability preemptionCapability) { + super.withPreemptionCapability(preemptionCapability); + return this; + } + + /** {@inheritDoc} */ + @Override + public PccRuleQosPolicy withPreemptionVulnerability(PreemptionVulnerability preemptionVulnerability) { + super.withPreemptionVulnerability(preemptionVulnerability); + return this; + } + + /** {@inheritDoc} */ + @Override + public PccRuleQosPolicy withMaximumBitRate(Ambr maximumBitRate) { + super.withMaximumBitRate(maximumBitRate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (guaranteedBitRate() != null) { + guaranteedBitRate().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PduSessionType.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PduSessionType.java new file mode 100644 index 000000000000..a11e2f1f5b64 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PduSessionType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PduSessionType. */ +public final class PduSessionType extends ExpandableStringEnum { + /** Static value IPv4 for PduSessionType. */ + public static final PduSessionType IPV4 = fromString("IPv4"); + + /** Static value IPv6 for PduSessionType. */ + public static final PduSessionType IPV6 = fromString("IPv6"); + + /** + * Creates or finds a PduSessionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PduSessionType. + */ + @JsonCreator + public static PduSessionType fromString(String name) { + return fromString(name, PduSessionType.class); + } + + /** @return known PduSessionType values. */ + public static Collection values() { + return values(PduSessionType.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PinholeTimeouts.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PinholeTimeouts.java new file mode 100644 index 000000000000..4a7dc6872f4f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PinholeTimeouts.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least 1 second. */ +@Fluent +public final class PinholeTimeouts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PinholeTimeouts.class); + + /* + * Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours + * 4 minutes per RFC 5382 section 5. + */ + @JsonProperty(value = "tcp") + private Integer tcp; + + /* + * Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 + * minutes per RFC 4787 section 4.3. + */ + @JsonProperty(value = "udp") + private Integer udp; + + /* + * Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is + * 60 seconds per RFC 5508 section 3.2. + */ + @JsonProperty(value = "icmp") + private Integer icmp; + + /** + * Get the tcp property: Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes per RFC + * 5382 section 5. + * + * @return the tcp value. + */ + public Integer tcp() { + return this.tcp; + } + + /** + * Set the tcp property: Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes per RFC + * 5382 section 5. + * + * @param tcp the tcp value to set. + * @return the PinholeTimeouts object itself. + */ + public PinholeTimeouts withTcp(Integer tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get the udp property: Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes per RFC 4787 + * section 4.3. + * + * @return the udp value. + */ + public Integer udp() { + return this.udp; + } + + /** + * Set the udp property: Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes per RFC 4787 + * section 4.3. + * + * @param udp the udp value to set. + * @return the PinholeTimeouts object itself. + */ + public PinholeTimeouts withUdp(Integer udp) { + this.udp = udp; + return this; + } + + /** + * Get the icmp property: Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds per RFC + * 5508 section 3.2. + * + * @return the icmp value. + */ + public Integer icmp() { + return this.icmp; + } + + /** + * Set the icmp property: Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds per RFC + * 5508 section 3.2. + * + * @param icmp the icmp value to set. + * @return the PinholeTimeouts object itself. + */ + public PinholeTimeouts withIcmp(Integer icmp) { + this.icmp = icmp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PlmnId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PlmnId.java new file mode 100644 index 000000000000..352acbc0d814 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PlmnId.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Public Land Mobile Network (PLMN) ID. */ +@Fluent +public final class PlmnId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PlmnId.class); + + /* + * Mobile Country Code (MCC). + */ + @JsonProperty(value = "mcc", required = true) + private String mcc; + + /* + * Mobile Network Code (MNC). + */ + @JsonProperty(value = "mnc", required = true) + private String mnc; + + /** + * Get the mcc property: Mobile Country Code (MCC). + * + * @return the mcc value. + */ + public String mcc() { + return this.mcc; + } + + /** + * Set the mcc property: Mobile Country Code (MCC). + * + * @param mcc the mcc value to set. + * @return the PlmnId object itself. + */ + public PlmnId withMcc(String mcc) { + this.mcc = mcc; + return this; + } + + /** + * Get the mnc property: Mobile Network Code (MNC). + * + * @return the mnc value. + */ + public String mnc() { + return this.mnc; + } + + /** + * Set the mnc property: Mobile Network Code (MNC). + * + * @param mnc the mnc value to set. + * @return the PlmnId object itself. + */ + public PlmnId withMnc(String mnc) { + this.mnc = mnc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mcc() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property mcc in model PlmnId")); + } + if (mnc() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property mnc in model PlmnId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortRange.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortRange.java new file mode 100644 index 000000000000..cd8eec30ea19 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortRange.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Range of port numbers to use as translated ports on each translated address. If not specified and NAPT is enabled, + * this range defaults to 1,024 - 65,535. (Ports under 1,024 should not be used because these are special purpose ports + * reserved by IANA.). + */ +@Fluent +public final class PortRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortRange.class); + + /* + * The minimum port number + */ + @JsonProperty(value = "minPort") + private Integer minPort; + + /* + * The maximum port number + */ + @JsonProperty(value = "maxPort") + private Integer maxPort; + + /** + * Get the minPort property: The minimum port number. + * + * @return the minPort value. + */ + public Integer minPort() { + return this.minPort; + } + + /** + * Set the minPort property: The minimum port number. + * + * @param minPort the minPort value to set. + * @return the PortRange object itself. + */ + public PortRange withMinPort(Integer minPort) { + this.minPort = minPort; + return this; + } + + /** + * Get the maxPort property: The maximum port number. + * + * @return the maxPort value. + */ + public Integer maxPort() { + return this.maxPort; + } + + /** + * Set the maxPort property: The maximum port number. + * + * @param maxPort the maxPort value to set. + * @return the PortRange object itself. + */ + public PortRange withMaxPort(Integer maxPort) { + this.maxPort = maxPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortReuseHoldTimes.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortReuseHoldTimes.java new file mode 100644 index 000000000000..4825273e4325 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PortReuseHoldTimes.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The minimum time (in seconds) that will pass before a port that was used by a closed pinhole can be recycled for use + * by another pinhole. All hold times must be minimum 1 second. + */ +@Fluent +public final class PortReuseHoldTimes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortReuseHoldTimes.class); + + /* + * Minimum time in seconds that will pass before a TCP port that was used + * by a closed pinhole can be reused. Default for TCP is 2 minutes. + */ + @JsonProperty(value = "tcp") + private Integer tcp; + + /* + * Minimum time in seconds that will pass before a UDP port that was used + * by a closed pinhole can be reused. Default for UDP is 1 minute. + */ + @JsonProperty(value = "udp") + private Integer udp; + + /** + * Get the tcp property: Minimum time in seconds that will pass before a TCP port that was used by a closed pinhole + * can be reused. Default for TCP is 2 minutes. + * + * @return the tcp value. + */ + public Integer tcp() { + return this.tcp; + } + + /** + * Set the tcp property: Minimum time in seconds that will pass before a TCP port that was used by a closed pinhole + * can be reused. Default for TCP is 2 minutes. + * + * @param tcp the tcp value to set. + * @return the PortReuseHoldTimes object itself. + */ + public PortReuseHoldTimes withTcp(Integer tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get the udp property: Minimum time in seconds that will pass before a UDP port that was used by a closed pinhole + * can be reused. Default for UDP is 1 minute. + * + * @return the udp value. + */ + public Integer udp() { + return this.udp; + } + + /** + * Set the udp property: Minimum time in seconds that will pass before a UDP port that was used by a closed pinhole + * can be reused. Default for UDP is 1 minute. + * + * @param udp the udp value to set. + * @return the PortReuseHoldTimes object itself. + */ + public PortReuseHoldTimes withUdp(Integer udp) { + this.udp = udp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionCapability.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionCapability.java new file mode 100644 index 000000000000..27bdb6fcda3b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionCapability.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreemptionCapability. */ +public final class PreemptionCapability extends ExpandableStringEnum { + /** Static value NotPreempt for PreemptionCapability. */ + public static final PreemptionCapability NOT_PREEMPT = fromString("NotPreempt"); + + /** Static value MayPreempt for PreemptionCapability. */ + public static final PreemptionCapability MAY_PREEMPT = fromString("MayPreempt"); + + /** + * Creates or finds a PreemptionCapability from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreemptionCapability. + */ + @JsonCreator + public static PreemptionCapability fromString(String name) { + return fromString(name, PreemptionCapability.class); + } + + /** @return known PreemptionCapability values. */ + public static Collection values() { + return values(PreemptionCapability.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionVulnerability.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionVulnerability.java new file mode 100644 index 000000000000..8465b3eb68f8 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/PreemptionVulnerability.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreemptionVulnerability. */ +public final class PreemptionVulnerability extends ExpandableStringEnum { + /** Static value NotPreemptable for PreemptionVulnerability. */ + public static final PreemptionVulnerability NOT_PREEMPTABLE = fromString("NotPreemptable"); + + /** Static value Preemptable for PreemptionVulnerability. */ + public static final PreemptionVulnerability PREEMPTABLE = fromString("Preemptable"); + + /** + * Creates or finds a PreemptionVulnerability from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreemptionVulnerability. + */ + @JsonCreator + public static PreemptionVulnerability fromString(String name) { + return fromString(name, PreemptionVulnerability.class); + } + + /** @return known PreemptionVulnerability values. */ + public static Collection values() { + return values(PreemptionVulnerability.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ProvisioningState.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ProvisioningState.java new file mode 100644 index 000000000000..63c39b43bcfb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ProvisioningState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for ProvisioningState. */ + public static final ProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/QosPolicy.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/QosPolicy.java new file mode 100644 index 000000000000..acc1e30806b4 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/QosPolicy.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** QoS policy. */ +@Fluent +public class QosPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosPolicy.class); + + /* + * QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS + * forwarding treatment to be provided to a flow. This must not be a + * standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. The + * illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, + * 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full + * description of the 5Qi parameter, and table 5.7.4-1 for the definition + * of which are the GBR 5QI values. + */ + @JsonProperty(value = "5qi") + private Integer fiveQi; + + /* + * QoS Flow allocation and retention priority (ARP) level. Flows with + * higher priority preempt flows with lower priority, if the settings of + * `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the + * highest level of priority. If this field is not specified then `5qi` is + * used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a + * full description of the ARP parameters. + */ + @JsonProperty(value = "allocationAndRetentionPriorityLevel") + private Integer allocationAndRetentionPriorityLevel; + + /* + * QoS Flow preemption capability. The Preemption Capability of a QoS Flow + * controls whether it can preempt another QoS Flow with a lower priority + * level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the + * ARP parameters. + */ + @JsonProperty(value = "preemptionCapability") + private PreemptionCapability preemptionCapability; + + /* + * QoS Flow preemption vulnerability. The Preemption Vulnerability of a + * QoS Flow controls whether it can be preempted by QoS Flow with a higher + * priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description + * of the ARP parameters. + */ + @JsonProperty(value = "preemptionVulnerability") + private PreemptionVulnerability preemptionVulnerability; + + /* + * The Maximum Bit Rate (MBR) for all service data flows that use this PCC + * Rule or Service. + */ + @JsonProperty(value = "maximumBitRate", required = true) + private Ambr maximumBitRate; + + /** + * Get the fiveQi property: QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment + * to be provided to a flow. This must not be a standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. + * The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP + * TS23.501 section 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for the definition of + * which are the GBR 5QI values. + * + * @return the fiveQi value. + */ + public Integer fiveQi() { + return this.fiveQi; + } + + /** + * Set the fiveQi property: QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment + * to be provided to a flow. This must not be a standardized 5QI value selecting a GBR (Guaranteed Bit Rate) QoS. + * The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP + * TS23.501 section 5.7.2.1 for a full description of the 5Qi parameter, and table 5.7.4-1 for the definition of + * which are the GBR 5QI values. + * + * @param fiveQi the fiveQi value to set. + * @return the QosPolicy object itself. + */ + public QosPolicy withFiveQi(Integer fiveQi) { + this.fiveQi = fiveQi; + return this; + } + + /** + * Get the allocationAndRetentionPriorityLevel property: QoS Flow allocation and retention priority (ARP) level. + * Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and + * `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` + * is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters. + * + * @return the allocationAndRetentionPriorityLevel value. + */ + public Integer allocationAndRetentionPriorityLevel() { + return this.allocationAndRetentionPriorityLevel; + } + + /** + * Set the allocationAndRetentionPriorityLevel property: QoS Flow allocation and retention priority (ARP) level. + * Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and + * `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` + * is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters. + * + * @param allocationAndRetentionPriorityLevel the allocationAndRetentionPriorityLevel value to set. + * @return the QosPolicy object itself. + */ + public QosPolicy withAllocationAndRetentionPriorityLevel(Integer allocationAndRetentionPriorityLevel) { + this.allocationAndRetentionPriorityLevel = allocationAndRetentionPriorityLevel; + return this; + } + + /** + * Get the preemptionCapability property: QoS Flow preemption capability. The Preemption Capability of a QoS Flow + * controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 + * for a full description of the ARP parameters. + * + * @return the preemptionCapability value. + */ + public PreemptionCapability preemptionCapability() { + return this.preemptionCapability; + } + + /** + * Set the preemptionCapability property: QoS Flow preemption capability. The Preemption Capability of a QoS Flow + * controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 + * for a full description of the ARP parameters. + * + * @param preemptionCapability the preemptionCapability value to set. + * @return the QosPolicy object itself. + */ + public QosPolicy withPreemptionCapability(PreemptionCapability preemptionCapability) { + this.preemptionCapability = preemptionCapability; + return this; + } + + /** + * Get the preemptionVulnerability property: QoS Flow preemption vulnerability. The Preemption Vulnerability of a + * QoS Flow controls whether it can be preempted by QoS Flow with a higher priority level. See 3GPP TS23.501 section + * 5.7.2.2 for a full description of the ARP parameters. + * + * @return the preemptionVulnerability value. + */ + public PreemptionVulnerability preemptionVulnerability() { + return this.preemptionVulnerability; + } + + /** + * Set the preemptionVulnerability property: QoS Flow preemption vulnerability. The Preemption Vulnerability of a + * QoS Flow controls whether it can be preempted by QoS Flow with a higher priority level. See 3GPP TS23.501 section + * 5.7.2.2 for a full description of the ARP parameters. + * + * @param preemptionVulnerability the preemptionVulnerability value to set. + * @return the QosPolicy object itself. + */ + public QosPolicy withPreemptionVulnerability(PreemptionVulnerability preemptionVulnerability) { + this.preemptionVulnerability = preemptionVulnerability; + return this; + } + + /** + * Get the maximumBitRate property: The Maximum Bit Rate (MBR) for all service data flows that use this PCC Rule or + * Service. + * + * @return the maximumBitRate value. + */ + public Ambr maximumBitRate() { + return this.maximumBitRate; + } + + /** + * Set the maximumBitRate property: The Maximum Bit Rate (MBR) for all service data flows that use this PCC Rule or + * Service. + * + * @param maximumBitRate the maximumBitRate value to set. + * @return the QosPolicy object itself. + */ + public QosPolicy withMaximumBitRate(Ambr maximumBitRate) { + this.maximumBitRate = maximumBitRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (maximumBitRate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property maximumBitRate in model QosPolicy")); + } else { + maximumBitRate().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SdfDirection.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SdfDirection.java new file mode 100644 index 000000000000..f6de69f3e393 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SdfDirection.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SdfDirection. */ +public final class SdfDirection extends ExpandableStringEnum { + /** Static value Uplink for SdfDirection. */ + public static final SdfDirection UPLINK = fromString("Uplink"); + + /** Static value Downlink for SdfDirection. */ + public static final SdfDirection DOWNLINK = fromString("Downlink"); + + /** Static value Bidirectional for SdfDirection. */ + public static final SdfDirection BIDIRECTIONAL = fromString("Bidirectional"); + + /** + * Creates or finds a SdfDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SdfDirection. + */ + @JsonCreator + public static SdfDirection fromString(String name) { + return fromString(name, SdfDirection.class); + } + + /** @return known SdfDirection values. */ + public static Collection values() { + return values(SdfDirection.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Service.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Service.java new file mode 100644 index 000000000000..5d70c4f88ff8 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Service.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Service. */ +public interface Service { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the service resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the servicePrecedence property: A precedence value that is used to decide between services when identifying + * the QoS values to use for a particular Sim. A lower value means a higher priority. This value should be unique + * among all services configured in the Mobile Network. + * + * @return the servicePrecedence value. + */ + int servicePrecedence(); + + /** + * Gets the serviceQosPolicy property: The QoS policy to use for packets matching this service. This can be + * overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * + * @return the serviceQosPolicy value. + */ + QosPolicy serviceQosPolicy(); + + /** + * Gets the pccRules property: The set of PCC Rules that make up this service. + * + * @return the pccRules value. + */ + List pccRules(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner object. + * + * @return the inner object. + */ + ServiceInner innerModel(); + + /** The entirety of the Service definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithServicePrecedence, + DefinitionStages.WithPccRules, + DefinitionStages.WithCreate { + } + /** The Service definition stages. */ + interface DefinitionStages { + /** The first stage of the Service definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Service definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Service definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, mobileNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @return the next definition stage. + */ + WithServicePrecedence withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName); + } + /** The stage of the Service definition allowing to specify servicePrecedence. */ + interface WithServicePrecedence { + /** + * Specifies the servicePrecedence property: A precedence value that is used to decide between services when + * identifying the QoS values to use for a particular Sim. A lower value means a higher priority. This value + * should be unique among all services configured in the Mobile Network.. + * + * @param servicePrecedence A precedence value that is used to decide between services when identifying the + * QoS values to use for a particular Sim. A lower value means a higher priority. This value should be + * unique among all services configured in the Mobile Network. + * @return the next definition stage. + */ + WithPccRules withServicePrecedence(int servicePrecedence); + } + /** The stage of the Service definition allowing to specify pccRules. */ + interface WithPccRules { + /** + * Specifies the pccRules property: The set of PCC Rules that make up this service.. + * + * @param pccRules The set of PCC Rules that make up this service. + * @return the next definition stage. + */ + WithCreate withPccRules(List pccRules); + } + /** + * The stage of the Service definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithServiceQosPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + Service create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Service create(Context context); + } + /** The stage of the Service definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Service definition allowing to specify serviceQosPolicy. */ + interface WithServiceQosPolicy { + /** + * Specifies the serviceQosPolicy property: The QoS policy to use for packets matching this service. This + * can be overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this + * field is null then the UE's simPolicy will define the QoS settings.. + * + * @param serviceQosPolicy The QoS policy to use for packets matching this service. This can be overridden + * for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null + * then the UE's simPolicy will define the QoS settings. + * @return the next definition stage. + */ + WithCreate withServiceQosPolicy(QosPolicy serviceQosPolicy); + } + } + /** + * Begins update for the Service resource. + * + * @return the stage of resource update. + */ + Service.Update update(); + + /** The template for Service update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Service apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Service apply(Context context); + } + /** The Service update stages. */ + interface UpdateStages { + /** The stage of the Service update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Service refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Service refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceDataFlowTemplate.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceDataFlowTemplate.java new file mode 100644 index 000000000000..c60c3fc3b675 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceDataFlowTemplate.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service data flow (SDF) template. */ +@Fluent +public final class ServiceDataFlowTemplate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceDataFlowTemplate.class); + + /* + * The name of the SDF template. This must be unique within the parent + * PccRuleConfiguration. You must not use any of the following reserved + * strings - `default`, `requested` or `service`. + */ + @JsonProperty(value = "templateName", required = true) + private String templateName; + + /* + * The direction of this flow. + */ + @JsonProperty(value = "direction", required = true) + private SdfDirection direction; + + /* + * A list of the allowed protocol(s) for this flow. If you want this flow + * to be able to use any protocol within the internet protocol suite, use + * the value `ip`. If you only want to allow a selection of protocols, you + * must use the corresponding IANA Assigned Internet Protocol Number for + * each protocol, as described in + * https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. + * For example, for UDP, you must use 17. If you use the value `ip` then + * you must leave the field `port` unspecified. + */ + @JsonProperty(value = "protocol", required = true) + private List protocol; + + /* + * The remote IP address(es) to which UEs will connect for this flow. If + * you want to allow connections on any IP address, use the value `any`. + * Otherwise, you must provide each of the remote IP addresses to which + * Fusion Core will connect for this flow. You must provide each IP address + * in CIDR notation, including the netmask (for example, 192.0.2.54/24). + */ + @JsonProperty(value = "remoteIpList", required = true) + private List remoteIpList; + + /* + * The port(s) to which UEs will connect for this flow. You can specify + * zero or more ports or port ranges. If you specify one or more ports or + * port ranges then you must specify a value other than `ip` in the + * `protocol` field. This is an optional setting. If you do not specify it + * then connections will be allowed on all ports. Port ranges must be + * specified as -. For example: [`8080`, `8082-8085`]. + */ + @JsonProperty(value = "ports") + private List ports; + + /** + * Get the templateName property: The name of the SDF template. This must be unique within the parent + * PccRuleConfiguration. You must not use any of the following reserved strings - `default`, `requested` or + * `service`. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: The name of the SDF template. This must be unique within the parent + * PccRuleConfiguration. You must not use any of the following reserved strings - `default`, `requested` or + * `service`. + * + * @param templateName the templateName value to set. + * @return the ServiceDataFlowTemplate object itself. + */ + public ServiceDataFlowTemplate withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Get the direction property: The direction of this flow. + * + * @return the direction value. + */ + public SdfDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of this flow. + * + * @param direction the direction value to set. + * @return the ServiceDataFlowTemplate object itself. + */ + public ServiceDataFlowTemplate withDirection(SdfDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: A list of the allowed protocol(s) for this flow. If you want this flow to be able to + * use any protocol within the internet protocol suite, use the value `ip`. If you only want to allow a selection of + * protocols, you must use the corresponding IANA Assigned Internet Protocol Number for each protocol, as described + * in https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. For example, for UDP, you must use + * 17. If you use the value `ip` then you must leave the field `port` unspecified. + * + * @return the protocol value. + */ + public List protocol() { + return this.protocol; + } + + /** + * Set the protocol property: A list of the allowed protocol(s) for this flow. If you want this flow to be able to + * use any protocol within the internet protocol suite, use the value `ip`. If you only want to allow a selection of + * protocols, you must use the corresponding IANA Assigned Internet Protocol Number for each protocol, as described + * in https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. For example, for UDP, you must use + * 17. If you use the value `ip` then you must leave the field `port` unspecified. + * + * @param protocol the protocol value to set. + * @return the ServiceDataFlowTemplate object itself. + */ + public ServiceDataFlowTemplate withProtocol(List protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the remoteIpList property: The remote IP address(es) to which UEs will connect for this flow. If you want to + * allow connections on any IP address, use the value `any`. Otherwise, you must provide each of the remote IP + * addresses to which Fusion Core will connect for this flow. You must provide each IP address in CIDR notation, + * including the netmask (for example, 192.0.2.54/24). + * + * @return the remoteIpList value. + */ + public List remoteIpList() { + return this.remoteIpList; + } + + /** + * Set the remoteIpList property: The remote IP address(es) to which UEs will connect for this flow. If you want to + * allow connections on any IP address, use the value `any`. Otherwise, you must provide each of the remote IP + * addresses to which Fusion Core will connect for this flow. You must provide each IP address in CIDR notation, + * including the netmask (for example, 192.0.2.54/24). + * + * @param remoteIpList the remoteIpList value to set. + * @return the ServiceDataFlowTemplate object itself. + */ + public ServiceDataFlowTemplate withRemoteIpList(List remoteIpList) { + this.remoteIpList = remoteIpList; + return this; + } + + /** + * Get the ports property: The port(s) to which UEs will connect for this flow. You can specify zero or more ports + * or port ranges. If you specify one or more ports or port ranges then you must specify a value other than `ip` in + * the `protocol` field. This is an optional setting. If you do not specify it then connections will be allowed on + * all ports. Port ranges must be specified as <FirstPort>-<LastPort>. For example: [`8080`, + * `8082-8085`]. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The port(s) to which UEs will connect for this flow. You can specify zero or more ports + * or port ranges. If you specify one or more ports or port ranges then you must specify a value other than `ip` in + * the `protocol` field. This is an optional setting. If you do not specify it then connections will be allowed on + * all ports. Port ranges must be specified as <FirstPort>-<LastPort>. For example: [`8080`, + * `8082-8085`]. + * + * @param ports the ports value to set. + * @return the ServiceDataFlowTemplate object itself. + */ + public ServiceDataFlowTemplate withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property templateName in model ServiceDataFlowTemplate")); + } + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model ServiceDataFlowTemplate")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model ServiceDataFlowTemplate")); + } + if (remoteIpList() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteIpList in model ServiceDataFlowTemplate")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceListResult.java new file mode 100644 index 000000000000..a4b4b37b44bb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.ServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for Services API service call. */ +@Fluent +public final class ServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceListResult.class); + + /* + * A list of Services. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of Services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Services. + * + * @param value the value value to set. + * @return the ServiceListResult object itself. + */ + public ServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceResourceId.java new file mode 100644 index 000000000000..afcf80e9a9ae --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/ServiceResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a Service resource. */ +@Fluent +public final class ServiceResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceId.class); + + /* + * Service resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Service resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Service resource ID. + * + * @param id the id value to set. + * @return the ServiceResourceId object itself. + */ + public ServiceResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model ServiceResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Services.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Services.java new file mode 100644 index 000000000000..828ede4dcc07 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Services.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Services. */ +public interface Services { + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String serviceName); + + /** + * Deletes the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String serviceName, Context context); + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service. + */ + Service get(String resourceGroupName, String mobileNetworkName, String serviceName); + + /** + * Gets information about the specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param serviceName The name of the service. You must not use any of the following reserved strings - `default`, + * `requested` or `service`. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String serviceName, Context context); + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Gets all the services in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the services in a mobile network as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response}. + */ + Service getById(String id); + + /** + * Gets information about the specified service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Service resource. + * + * @param name resource name. + * @return the first stage of the new Service definition. + */ + Service.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sim.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sim.java new file mode 100644 index 000000000000..81e6f77c63d6 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sim.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Sim. */ +public interface Sim { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the sim resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the configurationState property: The configuration state of the sim resource - complete or incomplete. + * + * @return the configurationState value. + */ + ConfigurationState configurationState(); + + /** + * Gets the internationalMobileSubscriberIdentity property: The International Mobile Subscriber Identity (IMSI) for + * the sim. + * + * @return the internationalMobileSubscriberIdentity value. + */ + String internationalMobileSubscriberIdentity(); + + /** + * Gets the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the sim. + * + * @return the integratedCircuitCardIdentifier value. + */ + String integratedCircuitCardIdentifier(); + + /** + * Gets the authenticationKey property: The ki value for the sim. + * + * @return the authenticationKey value. + */ + String authenticationKey(); + + /** + * Gets the operatorKeyCode property: The Opc value for the sim. + * + * @return the operatorKeyCode value. + */ + String operatorKeyCode(); + + /** + * Gets the mobileNetwork property: Mobile network that this sim belongs to. + * + * @return the mobileNetwork value. + */ + MobileNetworkResourceId mobileNetwork(); + + /** + * Gets the deviceType property: An optional free-form text field that can be used to record the device type this + * sim is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered based + * on this value. + * + * @return the deviceType value. + */ + String deviceType(); + + /** + * Gets the simPolicy property: The simPolicy used by this sim. + * + * @return the simPolicy value. + */ + SimPolicyResourceId simPolicy(); + + /** + * Gets the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each address is + * assigned at a defined network scope, made up of {attached data network, slice}. + * + * @return the staticIpConfiguration value. + */ + List staticIpConfiguration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner object. + * + * @return the inner object. + */ + SimInner innerModel(); + + /** The entirety of the Sim definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithInternationalMobileSubscriberIdentity, + DefinitionStages.WithCreate { + } + /** The Sim definition stages. */ + interface DefinitionStages { + /** The first stage of the Sim definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Sim definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Sim definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithInternationalMobileSubscriberIdentity withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Sim definition allowing to specify internationalMobileSubscriberIdentity. */ + interface WithInternationalMobileSubscriberIdentity { + /** + * Specifies the internationalMobileSubscriberIdentity property: The International Mobile Subscriber + * Identity (IMSI) for the sim.. + * + * @param internationalMobileSubscriberIdentity The International Mobile Subscriber Identity (IMSI) for the + * sim. + * @return the next definition stage. + */ + WithCreate withInternationalMobileSubscriberIdentity(String internationalMobileSubscriberIdentity); + } + /** + * The stage of the Sim definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIntegratedCircuitCardIdentifier, + DefinitionStages.WithAuthenticationKey, + DefinitionStages.WithOperatorKeyCode, + DefinitionStages.WithMobileNetwork, + DefinitionStages.WithDeviceType, + DefinitionStages.WithSimPolicy, + DefinitionStages.WithStaticIpConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Sim create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Sim create(Context context); + } + /** The stage of the Sim definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Sim definition allowing to specify integratedCircuitCardIdentifier. */ + interface WithIntegratedCircuitCardIdentifier { + /** + * Specifies the integratedCircuitCardIdentifier property: The Integrated Circuit Card ID (ICC Id) for the + * sim.. + * + * @param integratedCircuitCardIdentifier The Integrated Circuit Card ID (ICC Id) for the sim. + * @return the next definition stage. + */ + WithCreate withIntegratedCircuitCardIdentifier(String integratedCircuitCardIdentifier); + } + /** The stage of the Sim definition allowing to specify authenticationKey. */ + interface WithAuthenticationKey { + /** + * Specifies the authenticationKey property: The ki value for the sim.. + * + * @param authenticationKey The ki value for the sim. + * @return the next definition stage. + */ + WithCreate withAuthenticationKey(String authenticationKey); + } + /** The stage of the Sim definition allowing to specify operatorKeyCode. */ + interface WithOperatorKeyCode { + /** + * Specifies the operatorKeyCode property: The Opc value for the sim.. + * + * @param operatorKeyCode The Opc value for the sim. + * @return the next definition stage. + */ + WithCreate withOperatorKeyCode(String operatorKeyCode); + } + /** The stage of the Sim definition allowing to specify mobileNetwork. */ + interface WithMobileNetwork { + /** + * Specifies the mobileNetwork property: Mobile network that this sim belongs to. + * + * @param mobileNetwork Mobile network that this sim belongs to. + * @return the next definition stage. + */ + WithCreate withMobileNetwork(MobileNetworkResourceId mobileNetwork); + } + /** The stage of the Sim definition allowing to specify deviceType. */ + interface WithDeviceType { + /** + * Specifies the deviceType property: An optional free-form text field that can be used to record the device + * type this sim is associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped + * and filtered based on this value.. + * + * @param deviceType An optional free-form text field that can be used to record the device type this sim is + * associated with, for example 'Video camera'. The Azure portal allows Sims to be grouped and filtered + * based on this value. + * @return the next definition stage. + */ + WithCreate withDeviceType(String deviceType); + } + /** The stage of the Sim definition allowing to specify simPolicy. */ + interface WithSimPolicy { + /** + * Specifies the simPolicy property: The simPolicy used by this sim.. + * + * @param simPolicy The simPolicy used by this sim. + * @return the next definition stage. + */ + WithCreate withSimPolicy(SimPolicyResourceId simPolicy); + } + /** The stage of the Sim definition allowing to specify staticIpConfiguration. */ + interface WithStaticIpConfiguration { + /** + * Specifies the staticIpConfiguration property: A list of static IP addresses assigned to this sim. Each + * address is assigned at a defined network scope, made up of {attached data network, slice}.. + * + * @param staticIpConfiguration A list of static IP addresses assigned to this sim. Each address is assigned + * at a defined network scope, made up of {attached data network, slice}. + * @return the next definition stage. + */ + WithCreate withStaticIpConfiguration(List staticIpConfiguration); + } + } + /** + * Begins update for the Sim resource. + * + * @return the stage of resource update. + */ + Sim.Update update(); + + /** The template for Sim update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Sim apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Sim apply(Context context); + } + /** The Sim update stages. */ + interface UpdateStages { + /** The stage of the Sim update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Sim refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Sim refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimIdListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimIdListResult.java new file mode 100644 index 000000000000..1e7bb14c86aa --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimIdListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner; +import java.util.List; + +/** An immutable client-side representation of SimIdListResult. */ +public interface SimIdListResult { + /** + * Gets the value property: A list of sim profile ids in a resource group. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.SimIdListResultInner object. + * + * @return the inner object. + */ + SimIdListResultInner innerModel(); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimListResult.java new file mode 100644 index 000000000000..ae504e60433b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list Sims API service call. */ +@Fluent +public final class SimListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimListResult.class); + + /* + * A list of Sims in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of Sims in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Sims in a resource group. + * + * @param value the value value to set. + * @return the SimListResult object itself. + */ + public SimListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicies.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicies.java new file mode 100644 index 000000000000..38a47f3fd121 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicies.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SimPolicies. */ +public interface SimPolicies { + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName); + + /** + * Deletes the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context); + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy. + */ + SimPolicy get(String resourceGroupName, String mobileNetworkName, String simPolicyName); + + /** + * Gets information about the specified sim policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param simPolicyName The name of the SIM policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String simPolicyName, Context context); + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Gets all the simPolicies in a mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the simPolicies in a mobile network as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified sim policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response}. + */ + SimPolicy getById(String id); + + /** + * Gets information about the specified sim policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim policy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified sim policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified sim policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SimPolicy resource. + * + * @param name resource name. + * @return the first stage of the new SimPolicy definition. + */ + SimPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicy.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicy.java new file mode 100644 index 000000000000..2d0802312532 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicy.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SimPolicy. */ +public interface SimPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the sim policy resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given + * UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * + * @return the ueAmbr value. + */ + Ambr ueAmbr(); + + /** + * Gets the defaultSlice property: The default slice to use if the UE does not explicitly specify it. This slice + * must exist in the `sliceConfigurations` map. + * + * @return the defaultSlice value. + */ + SliceResourceId defaultSlice(); + + /** + * Gets the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an + * optional setting and by default is unspecified. + * + * @return the rfspIndex value. + */ + Integer rfspIndex(); + + /** + * Gets the registrationTimer property: Interval for the UE periodic registration update procedure, in seconds. + * + * @return the registrationTimer value. + */ + Integer registrationTimer(); + + /** + * Gets the sliceConfigurations property: The allowed slices and the settings to use for them. The list must not + * contain duplicate items and must contain at least one item. + * + * @return the sliceConfigurations value. + */ + List sliceConfigurations(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner object. + * + * @return the inner object. + */ + SimPolicyInner innerModel(); + + /** The entirety of the SimPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithUeAmbr, + DefinitionStages.WithDefaultSlice, + DefinitionStages.WithSliceConfigurations, + DefinitionStages.WithCreate { + } + /** The SimPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the SimPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SimPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SimPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, mobileNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @return the next definition stage. + */ + WithUeAmbr withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName); + } + /** The stage of the SimPolicy definition allowing to specify ueAmbr. */ + interface WithUeAmbr { + /** + * Specifies the ueAmbr property: Aggregate maximum bit rate across all non-GBR QoS flows of all PDU + * sessions of a given UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR.. + * + * @param ueAmbr Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given UE. + * See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR. + * @return the next definition stage. + */ + WithDefaultSlice withUeAmbr(Ambr ueAmbr); + } + /** The stage of the SimPolicy definition allowing to specify defaultSlice. */ + interface WithDefaultSlice { + /** + * Specifies the defaultSlice property: The default slice to use if the UE does not explicitly specify it. + * This slice must exist in the `sliceConfigurations` map.. + * + * @param defaultSlice The default slice to use if the UE does not explicitly specify it. This slice must + * exist in the `sliceConfigurations` map. + * @return the next definition stage. + */ + WithSliceConfigurations withDefaultSlice(SliceResourceId defaultSlice); + } + /** The stage of the SimPolicy definition allowing to specify sliceConfigurations. */ + interface WithSliceConfigurations { + /** + * Specifies the sliceConfigurations property: The allowed slices and the settings to use for them. The list + * must not contain duplicate items and must contain at least one item.. + * + * @param sliceConfigurations The allowed slices and the settings to use for them. The list must not contain + * duplicate items and must contain at least one item. + * @return the next definition stage. + */ + WithCreate withSliceConfigurations(List sliceConfigurations); + } + /** + * The stage of the SimPolicy definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithRfspIndex, DefinitionStages.WithRegistrationTimer { + /** + * Executes the create request. + * + * @return the created resource. + */ + SimPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SimPolicy create(Context context); + } + /** The stage of the SimPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SimPolicy definition allowing to specify rfspIndex. */ + interface WithRfspIndex { + /** + * Specifies the rfspIndex property: RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This + * is an optional setting and by default is unspecified.. + * + * @param rfspIndex RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an optional + * setting and by default is unspecified. + * @return the next definition stage. + */ + WithCreate withRfspIndex(Integer rfspIndex); + } + /** The stage of the SimPolicy definition allowing to specify registrationTimer. */ + interface WithRegistrationTimer { + /** + * Specifies the registrationTimer property: Interval for the UE periodic registration update procedure, in + * seconds.. + * + * @param registrationTimer Interval for the UE periodic registration update procedure, in seconds. + * @return the next definition stage. + */ + WithCreate withRegistrationTimer(Integer registrationTimer); + } + } + /** + * Begins update for the SimPolicy resource. + * + * @return the stage of resource update. + */ + SimPolicy.Update update(); + + /** The template for SimPolicy update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SimPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SimPolicy apply(Context context); + } + /** The SimPolicy update stages. */ + interface UpdateStages { + /** The stage of the SimPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SimPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SimPolicy refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyListResult.java new file mode 100644 index 000000000000..fdc0d50020d0 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SimPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for SimPolicies API service call. */ +@Fluent +public final class SimPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPolicyListResult.class); + + /* + * A list of SimPolicies. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of SimPolicies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of SimPolicies. + * + * @param value the value value to set. + * @return the SimPolicyListResult object itself. + */ + public SimPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyResourceId.java new file mode 100644 index 000000000000..58e28219c9dc --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimPolicyResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a SIM Policy resource. */ +@Fluent +public final class SimPolicyResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimPolicyResourceId.class); + + /* + * SIM Policy resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: SIM Policy resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: SIM Policy resource ID. + * + * @param id the id value to set. + * @return the SimPolicyResourceId object itself. + */ + public SimPolicyResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model SimPolicyResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpProperties.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpProperties.java new file mode 100644 index 000000000000..6d2b9e958675 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Static IP configuration for a sim, scoped to a particular attached data network and slice. */ +@Fluent +public final class SimStaticIpProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimStaticIpProperties.class); + + /* + * The attached data network on which the static IP address will be used. + * The combination of attachedDataNetwork and slice defines the network + * scope of the IP address. + */ + @JsonProperty(value = "attachedDataNetwork") + private AttachedDataNetworkResourceId attachedDataNetwork; + + /* + * The network slice on which the static IP address will be used. The + * combination of attachedDataNetwork and slice defines the network scope + * of the IP address. + */ + @JsonProperty(value = "slice") + private SliceResourceId slice; + + /* + * The static IP configuration for the sim to use at the defined network + * scope. + */ + @JsonProperty(value = "staticIp") + private SimStaticIpPropertiesStaticIp staticIp; + + /** + * Get the attachedDataNetwork property: The attached data network on which the static IP address will be used. The + * combination of attachedDataNetwork and slice defines the network scope of the IP address. + * + * @return the attachedDataNetwork value. + */ + public AttachedDataNetworkResourceId attachedDataNetwork() { + return this.attachedDataNetwork; + } + + /** + * Set the attachedDataNetwork property: The attached data network on which the static IP address will be used. The + * combination of attachedDataNetwork and slice defines the network scope of the IP address. + * + * @param attachedDataNetwork the attachedDataNetwork value to set. + * @return the SimStaticIpProperties object itself. + */ + public SimStaticIpProperties withAttachedDataNetwork(AttachedDataNetworkResourceId attachedDataNetwork) { + this.attachedDataNetwork = attachedDataNetwork; + return this; + } + + /** + * Get the slice property: The network slice on which the static IP address will be used. The combination of + * attachedDataNetwork and slice defines the network scope of the IP address. + * + * @return the slice value. + */ + public SliceResourceId slice() { + return this.slice; + } + + /** + * Set the slice property: The network slice on which the static IP address will be used. The combination of + * attachedDataNetwork and slice defines the network scope of the IP address. + * + * @param slice the slice value to set. + * @return the SimStaticIpProperties object itself. + */ + public SimStaticIpProperties withSlice(SliceResourceId slice) { + this.slice = slice; + return this; + } + + /** + * Get the staticIp property: The static IP configuration for the sim to use at the defined network scope. + * + * @return the staticIp value. + */ + public SimStaticIpPropertiesStaticIp staticIp() { + return this.staticIp; + } + + /** + * Set the staticIp property: The static IP configuration for the sim to use at the defined network scope. + * + * @param staticIp the staticIp value to set. + * @return the SimStaticIpProperties object itself. + */ + public SimStaticIpProperties withStaticIp(SimStaticIpPropertiesStaticIp staticIp) { + this.staticIp = staticIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attachedDataNetwork() != null) { + attachedDataNetwork().validate(); + } + if (slice() != null) { + slice().validate(); + } + if (staticIp() != null) { + staticIp().validate(); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpPropertiesStaticIp.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpPropertiesStaticIp.java new file mode 100644 index 000000000000..9dbaafef34da --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SimStaticIpPropertiesStaticIp.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The static IP configuration for the sim to use at the defined network scope. */ +@Fluent +public final class SimStaticIpPropertiesStaticIp { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SimStaticIpPropertiesStaticIp.class); + + /* + * The IPv4 address assigned to the sim at this network scope. This address + * must be in the userEquipmentStaticAddressPoolPrefix defined in the + * attachedDataNetwork. + */ + @JsonProperty(value = "ipv4Address") + private String ipv4Address; + + /** + * Get the ipv4Address property: The IPv4 address assigned to the sim at this network scope. This address must be in + * the userEquipmentStaticAddressPoolPrefix defined in the attachedDataNetwork. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Set the ipv4Address property: The IPv4 address assigned to the sim at this network scope. This address must be in + * the userEquipmentStaticAddressPoolPrefix defined in the attachedDataNetwork. + * + * @param ipv4Address the ipv4Address value to set. + * @return the SimStaticIpPropertiesStaticIp object itself. + */ + public SimStaticIpPropertiesStaticIp withIpv4Address(String ipv4Address) { + this.ipv4Address = ipv4Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sims.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sims.java new file mode 100644 index 000000000000..29d8d6e1d5b5 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sims.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Sims. */ +public interface Sims { + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String simName); + + /** + * Deletes the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String simName, Context context); + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim. + */ + Sim getByResourceGroup(String resourceGroupName, String simName); + + /** + * Gets information about the specified sim. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param simName The name of the SIM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String simName, Context context); + + /** + * Gets all the sims in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the sims in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the sims in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Sims in a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Sims in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified sim. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response}. + */ + Sim getById(String id); + + /** + * Gets information about the specified sim. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified sim along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified sim. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified sim. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Sim resource. + * + * @param name resource name. + * @return the first stage of the new Sim definition. + */ + Sim.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Site.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Site.java new file mode 100644 index 000000000000..a1ff73765c0f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Site.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Site. */ +public interface Site { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the site resource. **TODO**: Confirm if this is + * needed. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the networkFunctions property: An array of ids of the network functions deployed on the site, maintained by + * the user. + * + * @return the networkFunctions value. + */ + List networkFunctions(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner object. + * + * @return the inner object. + */ + SiteInner innerModel(); + + /** The entirety of the Site definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Site definition stages. */ + interface DefinitionStages { + /** The first stage of the Site definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Site definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Site definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, mobileNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @return the next definition stage. + */ + WithCreate withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName); + } + /** + * The stage of the Site definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithNetworkFunctions { + /** + * Executes the create request. + * + * @return the created resource. + */ + Site create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Site create(Context context); + } + /** The stage of the Site definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Site definition allowing to specify networkFunctions. */ + interface WithNetworkFunctions { + /** + * Specifies the networkFunctions property: An array of ids of the network functions deployed on the site, + * maintained by the user.. + * + * @param networkFunctions An array of ids of the network functions deployed on the site, maintained by the + * user. + * @return the next definition stage. + */ + WithCreate withNetworkFunctions(List networkFunctions); + } + } + /** + * Begins update for the Site resource. + * + * @return the stage of resource update. + */ + Site.Update update(); + + /** The template for Site update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Site apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Site apply(Context context); + } + /** The Site update stages. */ + interface UpdateStages { + /** The stage of the Site update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Site refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Site refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SiteListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SiteListResult.java new file mode 100644 index 000000000000..53d4f391216c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SiteListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for sites API service call. */ +@Fluent +public final class SiteListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SiteListResult.class); + + /* + * A list of sites in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of sites in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of sites in a resource group. + * + * @param value the value value to set. + * @return the SiteListResult object itself. + */ + public SiteListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sites.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sites.java new file mode 100644 index 000000000000..a6b30b214f91 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Sites.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Sites. */ +public interface Sites { + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String siteName); + + /** + * Deletes the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String siteName, Context context); + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site. + */ + Site get(String resourceGroupName, String mobileNetworkName, String siteName); + + /** + * Gets information about the specified mobile network site. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param siteName The name of the mobile network site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String siteName, Context context); + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all sites in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for sites API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network site. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response}. + */ + Site getById(String id); + + /** + * Gets information about the specified mobile network site. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network site along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified mobile network site. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified mobile network site. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Site resource. + * + * @param name resource name. + * @return the first stage of the new Site definition. + */ + Site.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slice.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slice.java new file mode 100644 index 000000000000..0f63313a18ef --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slice.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import java.util.Map; + +/** An immutable client-side representation of Slice. */ +public interface Slice { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The provisioning state of the network slice resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the snssai property: The S-NSSAI (single network slice selection assistance information). Unique at the + * scope of a MobileNetwork. + * + * @return the snssai value. + */ + Snssai snssai(); + + /** + * Gets the description property: An optional description for this network slice. + * + * @return the description value. + */ + String description(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner object. + * + * @return the inner object. + */ + SliceInner innerModel(); + + /** The entirety of the Slice definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSnssai, + DefinitionStages.WithCreate { + } + /** The Slice definition stages. */ + interface DefinitionStages { + /** The first stage of the Slice definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Slice definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Slice definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, mobileNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @return the next definition stage. + */ + WithSnssai withExistingMobileNetwork(String resourceGroupName, String mobileNetworkName); + } + /** The stage of the Slice definition allowing to specify snssai. */ + interface WithSnssai { + /** + * Specifies the snssai property: The S-NSSAI (single network slice selection assistance information). + * Unique at the scope of a MobileNetwork.. + * + * @param snssai The S-NSSAI (single network slice selection assistance information). Unique at the scope of + * a MobileNetwork. + * @return the next definition stage. + */ + WithCreate withSnssai(Snssai snssai); + } + /** + * The stage of the Slice definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + Slice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Slice create(Context context); + } + /** The stage of the Slice definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Slice definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: An optional description for this network slice.. + * + * @param description An optional description for this network slice. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + /** + * Begins update for the Slice resource. + * + * @return the stage of resource update. + */ + Slice.Update update(); + + /** The template for Slice update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Slice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Slice apply(Context context); + } + /** The Slice update stages. */ + interface UpdateStages { + /** The stage of the Slice update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Slice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Slice refresh(Context context); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceConfiguration.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceConfiguration.java new file mode 100644 index 000000000000..75f4bd8b1301 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceConfiguration.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Per-slice settings. */ +@Fluent +public final class SliceConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SliceConfiguration.class); + + /* + * A reference to the Slice that these settings apply to + */ + @JsonProperty(value = "slice", required = true) + private SliceResourceId slice; + + /* + * The default data network to use if the UE does not explicitly specify + * it. Configuration for this object must exist in the + * `dataNetworkConfigurations` map. + */ + @JsonProperty(value = "defaultDataNetwork", required = true) + private DataNetworkResourceId defaultDataNetwork; + + /* + * The allowed data networks and the settings to use for them. The list + * must not contain duplicate items and must contain at least one item. + */ + @JsonProperty(value = "dataNetworkConfigurations", required = true) + private List dataNetworkConfigurations; + + /** + * Get the slice property: A reference to the Slice that these settings apply to. + * + * @return the slice value. + */ + public SliceResourceId slice() { + return this.slice; + } + + /** + * Set the slice property: A reference to the Slice that these settings apply to. + * + * @param slice the slice value to set. + * @return the SliceConfiguration object itself. + */ + public SliceConfiguration withSlice(SliceResourceId slice) { + this.slice = slice; + return this; + } + + /** + * Get the defaultDataNetwork property: The default data network to use if the UE does not explicitly specify it. + * Configuration for this object must exist in the `dataNetworkConfigurations` map. + * + * @return the defaultDataNetwork value. + */ + public DataNetworkResourceId defaultDataNetwork() { + return this.defaultDataNetwork; + } + + /** + * Set the defaultDataNetwork property: The default data network to use if the UE does not explicitly specify it. + * Configuration for this object must exist in the `dataNetworkConfigurations` map. + * + * @param defaultDataNetwork the defaultDataNetwork value to set. + * @return the SliceConfiguration object itself. + */ + public SliceConfiguration withDefaultDataNetwork(DataNetworkResourceId defaultDataNetwork) { + this.defaultDataNetwork = defaultDataNetwork; + return this; + } + + /** + * Get the dataNetworkConfigurations property: The allowed data networks and the settings to use for them. The list + * must not contain duplicate items and must contain at least one item. + * + * @return the dataNetworkConfigurations value. + */ + public List dataNetworkConfigurations() { + return this.dataNetworkConfigurations; + } + + /** + * Set the dataNetworkConfigurations property: The allowed data networks and the settings to use for them. The list + * must not contain duplicate items and must contain at least one item. + * + * @param dataNetworkConfigurations the dataNetworkConfigurations value to set. + * @return the SliceConfiguration object itself. + */ + public SliceConfiguration withDataNetworkConfigurations(List dataNetworkConfigurations) { + this.dataNetworkConfigurations = dataNetworkConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (slice() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property slice in model SliceConfiguration")); + } else { + slice().validate(); + } + if (defaultDataNetwork() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property defaultDataNetwork in model SliceConfiguration")); + } else { + defaultDataNetwork().validate(); + } + if (dataNetworkConfigurations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataNetworkConfigurations in model SliceConfiguration")); + } else { + dataNetworkConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceListResult.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceListResult.java new file mode 100644 index 000000000000..212be54cca7a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mobilenetwork.fluent.models.SliceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for attached data network API service call. */ +@Fluent +public final class SliceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SliceListResult.class); + + /* + * A list of data networks in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of data networks in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of data networks in a resource group. + * + * @param value the value value to set. + * @return the SliceListResult object itself. + */ + public SliceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceResourceId.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceResourceId.java new file mode 100644 index 000000000000..14a0ca0597c3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/SliceResourceId.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.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a Slice resource. */ +@Fluent +public final class SliceResourceId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SliceResourceId.class); + + /* + * Slice resource ID. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Slice resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Slice resource ID. + * + * @param id the id value to set. + * @return the SliceResourceId object itself. + */ + public SliceResourceId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model SliceResourceId")); + } + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slices.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slices.java new file mode 100644 index 000000000000..3894a9fd90bd --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Slices.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Slices. */ +public interface Slices { + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String sliceName); + + /** + * Deletes the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String mobileNetworkName, String sliceName, Context context); + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice. + */ + Slice get(String resourceGroupName, String mobileNetworkName, String sliceName); + + /** + * Gets information about the specified mobile network slice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param sliceName The name of the mobile network slice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String mobileNetworkName, String sliceName, Context context); + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName); + + /** + * Lists all slices in the mobile network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param mobileNetworkName The name of the mobile network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for attached data network API service call as paginated response with {@link PagedIterable}. + */ + PagedIterable listByMobileNetwork(String resourceGroupName, String mobileNetworkName, Context context); + + /** + * Gets information about the specified mobile network slice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response}. + */ + Slice getById(String id); + + /** + * Gets information about the specified mobile network slice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified mobile network slice along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified mobile network slice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified mobile network slice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Slice resource. + * + * @param name resource name. + * @return the first stage of the new Slice definition. + */ + Slice.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Snssai.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Snssai.java new file mode 100644 index 000000000000..829631e5691a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/Snssai.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Single-Network Slice Selection Assistance Information (S-NSSAI). */ +@Fluent +public final class Snssai { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Snssai.class); + + /* + * Slice/Service Type (SST). + */ + @JsonProperty(value = "sst", required = true) + private int sst; + + /* + * Slice Differentiator (SD). + */ + @JsonProperty(value = "sd") + private String sd; + + /** + * Get the sst property: Slice/Service Type (SST). + * + * @return the sst value. + */ + public int sst() { + return this.sst; + } + + /** + * Set the sst property: Slice/Service Type (SST). + * + * @param sst the sst value to set. + * @return the Snssai object itself. + */ + public Snssai withSst(int sst) { + this.sst = sst; + return this; + } + + /** + * Get the sd property: Slice Differentiator (SD). + * + * @return the sd value. + */ + public String sd() { + return this.sd; + } + + /** + * Set the sd property: Slice Differentiator (SD). + * + * @param sd the sd value to set. + * @return the Snssai object itself. + */ + public Snssai withSd(String sd) { + this.sd = sd; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TagsObject.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TagsObject.java new file mode 100644 index 000000000000..6ce402e49a8f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TagsObject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TrafficControlPermission.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TrafficControlPermission.java new file mode 100644 index 000000000000..9fa6bff8989c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/TrafficControlPermission.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrafficControlPermission. */ +public final class TrafficControlPermission extends ExpandableStringEnum { + /** Static value Enabled for TrafficControlPermission. */ + public static final TrafficControlPermission ENABLED = fromString("Enabled"); + + /** Static value Blocked for TrafficControlPermission. */ + public static final TrafficControlPermission BLOCKED = fromString("Blocked"); + + /** + * Creates or finds a TrafficControlPermission from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrafficControlPermission. + */ + @JsonCreator + public static TrafficControlPermission fromString(String name) { + return fromString(name, TrafficControlPermission.class); + } + + /** @return known TrafficControlPermission values. */ + public static Collection values() { + return values(TrafficControlPermission.class); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/package-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/package-info.java new file mode 100644 index 000000000000..d0f8fb1489cd --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for MobileNetworkManagementClient. The resources in this swagger specification + * will be used to manage attached data network resources in mobile network attached to a particular packet core + * instance. + */ +package com.azure.resourcemanager.mobilenetwork.models; diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/package-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/package-info.java new file mode 100644 index 000000000000..8a1d7b6cffc3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for MobileNetworkManagementClient. The resources in this swagger specification will be + * used to manage attached data network resources in mobile network attached to a particular packet core instance. + */ +package com.azure.resourcemanager.mobilenetwork; diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/module-info.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/module-info.java new file mode 100644 index 000000000000..33e8683e643f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.mobilenetwork { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.mobilenetwork; + exports com.azure.resourcemanager.mobilenetwork.fluent; + exports com.azure.resourcemanager.mobilenetwork.fluent.models; + exports com.azure.resourcemanager.mobilenetwork.models; + + opens com.azure.resourcemanager.mobilenetwork.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.mobilenetwork.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e5af824477b7 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.NaptConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.NaptEnabled; +import com.azure.resourcemanager.mobilenetwork.models.PinholeTimeouts; +import com.azure.resourcemanager.mobilenetwork.models.PortRange; +import com.azure.resourcemanager.mobilenetwork.models.PortReuseHoldTimes; +import java.util.Arrays; + +/** Samples for AttachedDataNetworks CreateOrUpdate. */ +public final class AttachedDataNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkCreate.json + */ + /** + * Sample code: Create attached data network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createAttachedDataNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .define("TestAttachedDataNetwork") + .withRegion("eastus") + .withExistingPacketCoreDataPlane("rg1", "TestPacketCoreCP", "TestPacketCoreDP") + .withUserPlaneDataInterface(new InterfaceProperties().withName("N6")) + .withNaptConfiguration( + new NaptConfiguration() + .withEnabled(NaptEnabled.ENABLED) + .withPortRange(new PortRange().withMinPort(1024).withMaxPort(65535)) + .withPortReuseHoldTime(new PortReuseHoldTimes().withTcp(120).withUdp(60)) + .withPinholeLimits(65536) + .withPinholeTimeouts(new PinholeTimeouts().withTcp(7440).withUdp(300).withIcmp(60))) + .withUserEquipmentAddressPoolPrefix(Arrays.asList("2.2.0.0/16")) + .withUserEquipmentStaticAddressPoolPrefix(Arrays.asList("2.4.0.0/16")) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteSamples.java new file mode 100644 index 000000000000..aba767e35d87 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks Delete. */ +public final class AttachedDataNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkDelete.json + */ + /** + * Sample code: Delete attached data network resource. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteAttachedDataNetworkResource( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .delete("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetSamples.java new file mode 100644 index 000000000000..1d3a06670424 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks Get. */ +public final class AttachedDataNetworksGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkGet.json + */ + /** + * Sample code: Get attached data network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getAttachedDataNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .getWithResponse("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneSamples.java new file mode 100644 index 000000000000..5c48ec6b0ac4 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksListByPacketCoreDataPlaneSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for AttachedDataNetworks ListByPacketCoreDataPlane. */ +public final class AttachedDataNetworksListByPacketCoreDataPlaneSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkListByPacketCoreDataPlane.json + */ + /** + * Sample code: List attached data networks in a data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listAttachedDataNetworksInADataPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .attachedDataNetworks() + .listByPacketCoreDataPlane("rg1", "TestPacketCoreCP", "TestPacketCoreDP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksUpdateTagsSamples.java new file mode 100644 index 000000000000..0855b6d548eb --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/AttachedDataNetworksUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AttachedDataNetworks UpdateTags. */ +public final class AttachedDataNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/AttachedDataNetworkUpdateTags.json + */ + /** + * Sample code: Update attached data network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateAttachedDataNetworkTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + AttachedDataNetwork resource = + manager + .attachedDataNetworks() + .getWithResponse("rg1", "TestPacketCoreCP", "TestPacketCoreDP", "TestAttachedDataNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..90fe4378fd59 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +/** Samples for DataNetworks CreateOrUpdate. */ +public final class DataNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkCreate.json + */ + /** + * Sample code: Create mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .dataNetworks() + .define("testDataNetwork") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withDescription("myFavouriteDataNetwork") + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteSamples.java new file mode 100644 index 000000000000..c3d099e4ed82 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DataNetworks Delete. */ +public final class DataNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkDelete.json + */ + /** + * Sample code: Delete mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().delete("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetSamples.java new file mode 100644 index 000000000000..e310eceec275 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DataNetworks Get. */ +public final class DataNetworksGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkGet.json + */ + /** + * Sample code: Get mobile network dataNetwork. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkDataNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().getWithResponse("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkSamples.java new file mode 100644 index 000000000000..bcf6fb1a6984 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksListByMobileNetworkSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DataNetworks ListByMobileNetwork. */ +public final class DataNetworksListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkListByMobileNetwork.json + */ + /** + * Sample code: List mobile network dataNetworks in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkDataNetworksInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.dataNetworks().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksUpdateTagsSamples.java new file mode 100644 index 000000000000..0c5f05ce3b60 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/DataNetworksUpdateTagsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.DataNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DataNetworks UpdateTags. */ +public final class DataNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/DataNetworkUpdateTags.json + */ + /** + * Sample code: Update data network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateDataNetworkTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + DataNetwork resource = + manager + .dataNetworks() + .getWithResponse("rg1", "testMobileNetwork", "testDataNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1ca8ad28822c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.PlmnId; + +/** Samples for MobileNetworks CreateOrUpdate. */ +public final class MobileNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkCreate.json + */ + /** + * Sample code: Create mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .mobileNetworks() + .define("testMobileNetwork") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withPublicLandMobileNetworkIdentifier(new PlmnId().withMcc("001").withMnc("01")) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteSamples.java new file mode 100644 index 000000000000..2b5bc191b61b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for MobileNetworks Delete. */ +public final class MobileNetworksDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkDelete.json + */ + /** + * Sample code: Delete mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().delete("rg1", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksGetByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3ef4b8b02094 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for MobileNetworks GetByResourceGroup. */ +public final class MobileNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkGet.json + */ + /** + * Sample code: Get mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetwork(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().getByResourceGroupWithResponse("rg1", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..d52f8976d6ca --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for MobileNetworks ListByResourceGroup. */ +public final class MobileNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListByResourceGroup.json + */ + /** + * Sample code: List mobile networks in resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworksInResourceGroup( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSamples.java new file mode 100644 index 000000000000..3deedcb15947 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for MobileNetworks List. */ +public final class MobileNetworksListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkListBySubscription.json + */ + /** + * Sample code: List mobile networks in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworksInASubscription( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().list(Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSimIdsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSimIdsSamples.java new file mode 100644 index 000000000000..42535e4f57b1 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksListSimIdsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for MobileNetworks ListSimIds. */ +public final class MobileNetworksListSimIdsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimIdListByMobileNetwork.json + */ + /** + * Sample code: List sim profile ids by network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimProfileIdsByNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.mobileNetworks().listSimIds("rg", "testMobileNetworkName", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksUpdateTagsSamples.java new file mode 100644 index 000000000000..4886daf2cc4d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/MobileNetworksUpdateTagsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MobileNetworks UpdateTags. */ +public final class MobileNetworksUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/MobileNetworkUpdateTags.json + */ + /** + * Sample code: Update mobile network tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + MobileNetwork resource = + manager + .mobileNetworks() + .getByResourceGroupWithResponse("rg1", "testMobileNetwork", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListSamples.java new file mode 100644 index 000000000000..4ad796dcdb4f --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/OperationList.json + */ + /** + * Sample code: Get Registration Operations. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getRegistrationOperations(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4b7cb1b78654 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.CoreNetworkType; +import com.azure.resourcemanager.mobilenetwork.models.CustomLocationResourceId; +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; + +/** Samples for PacketCoreControlPlanes CreateOrUpdate. */ +public final class PacketCoreControlPlanesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneCreate.json + */ + /** + * Sample code: Create packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createPacketCoreControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .packetCoreControlPlanes() + .define("TestPacketCoreCP") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withMobileNetwork( + new MobileNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork")) + .withControlPlaneAccessInterface(new InterfaceProperties().withName("N2")) + .withCustomLocation( + new CustomLocationResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/TestCustomLocation")) + .withCoreNetworkTechnology(CoreNetworkType.FIVE_GC) + .withVersion("0.2.0") + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteSamples.java new file mode 100644 index 000000000000..a7c57f0a108a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes Delete. */ +public final class PacketCoreControlPlanesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneDelete.json + */ + /** + * Sample code: Delete packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deletePacketCoreControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().delete("rg1", "TestPacketCoreCP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..763b4306dbf9 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes GetByResourceGroup. */ +public final class PacketCoreControlPlanesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneGet.json + */ + /** + * Sample code: Get packet core control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getPacketCoreControlPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().getByResourceGroupWithResponse("rg1", "TestPacketCoreCP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupSamples.java new file mode 100644 index 000000000000..ebf259c8483c --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes ListByResourceGroup. */ +public final class PacketCoreControlPlanesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListByResourceGroup.json + */ + /** + * Sample code: List packet core control planes in resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreControlPlanesInResourceGroup( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListSamples.java new file mode 100644 index 000000000000..35ffdfc2dee3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreControlPlanes List. */ +public final class PacketCoreControlPlanesListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneListBySubscription.json + */ + /** + * Sample code: List packet core control planes in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreControlPlanesInASubscription( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreControlPlanes().list(Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesUpdateTagsSamples.java new file mode 100644 index 000000000000..ebc84e9ae262 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreControlPlanesUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreControlPlane; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PacketCoreControlPlanes UpdateTags. */ +public final class PacketCoreControlPlanesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreControlPlaneUpdateTags.json + */ + /** + * Sample code: Update packet core control plane tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updatePacketCoreControlPlaneTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + PacketCoreControlPlane resource = + manager + .packetCoreControlPlanes() + .getByResourceGroupWithResponse("rg1", "TestPacketCoreCP", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5efc7bc5f7f0 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.InterfaceProperties; + +/** Samples for PacketCoreDataPlanes CreateOrUpdate. */ +public final class PacketCoreDataPlanesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneCreate.json + */ + /** + * Sample code: Create packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createPacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .packetCoreDataPlanes() + .define("testPacketCoreDP") + .withRegion("eastus") + .withExistingPacketCoreControlPlane("rg1", "testPacketCoreCP") + .withUserPlaneAccessInterface(new InterfaceProperties().withName("N3")) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteSamples.java new file mode 100644 index 000000000000..b829b1f80ade --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes Delete. */ +public final class PacketCoreDataPlanesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneDelete.json + */ + /** + * Sample code: Delete packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deletePacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().delete("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetSamples.java new file mode 100644 index 000000000000..e931b12d7096 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes Get. */ +public final class PacketCoreDataPlanesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneGet.json + */ + /** + * Sample code: Get packet core data plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getPacketCoreDataPlane(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().getWithResponse("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneSamples.java new file mode 100644 index 000000000000..4dac26f5de2d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesListByPacketCoreControlPlaneSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for PacketCoreDataPlanes ListByPacketCoreControlPlane. */ +public final class PacketCoreDataPlanesListByPacketCoreControlPlaneSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneListByPacketCoreControlPlane.json + */ + /** + * Sample code: List packet core data planes in a control plane. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listPacketCoreDataPlanesInAControlPlane( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.packetCoreDataPlanes().listByPacketCoreControlPlane("rg1", "testPacketCoreCP", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesUpdateTagsSamples.java new file mode 100644 index 000000000000..fbeb30ee3971 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/PacketCoreDataPlanesUpdateTagsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.PacketCoreDataPlane; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PacketCoreDataPlanes UpdateTags. */ +public final class PacketCoreDataPlanesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/PacketCoreDataPlaneUpdateTags.json + */ + /** + * Sample code: Update packet core data plane tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updatePacketCoreDataPlaneTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + PacketCoreDataPlane resource = + manager + .packetCoreDataPlanes() + .getWithResponse("rg1", "testPacketCoreCP", "testPacketCoreDP", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..90bfc52afa1d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesCreateOrUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.PccRuleQosPolicy; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; +import com.azure.resourcemanager.mobilenetwork.models.QosPolicy; +import com.azure.resourcemanager.mobilenetwork.models.SdfDirection; +import com.azure.resourcemanager.mobilenetwork.models.ServiceDataFlowTemplate; +import com.azure.resourcemanager.mobilenetwork.models.TrafficControlPermission; +import java.util.Arrays; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceCreate.json + */ + /** + * Sample code: Create service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .services() + .define("TestService") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withServicePrecedence(255) + .withPccRules( + Arrays + .asList( + new PccRuleConfiguration() + .withRuleName("default-rule") + .withRulePrecedence(255) + .withRuleQosPolicy( + new PccRuleQosPolicy() + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withMaximumBitRate(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps"))) + .withTrafficControl(TrafficControlPermission.ENABLED) + .withServiceDataFlowTemplates( + Arrays + .asList( + new ServiceDataFlowTemplate() + .withTemplateName("IP-to-server") + .withDirection(SdfDirection.UPLINK) + .withProtocol(Arrays.asList("ip")) + .withRemoteIpList(Arrays.asList("10.3.4.0/24")) + .withPorts(Arrays.asList()))))) + .withServiceQosPolicy( + new QosPolicy() + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withMaximumBitRate(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps"))) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteSamples.java new file mode 100644 index 000000000000..f2944763e63d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceDelete.json + */ + /** + * Sample code: Delete service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().delete("rg1", "testMobileNetwork", "TestService", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetSamples.java new file mode 100644 index 000000000000..480039219b78 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceGet.json + */ + /** + * Sample code: Get service. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getService(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().getWithResponse("rg1", "testMobileNetwork", "TestService", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkSamples.java new file mode 100644 index 000000000000..bd6dc28ae45a --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesListByMobileNetworkSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Services ListByMobileNetwork. */ +public final class ServicesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceListByMobileNetwork.json + */ + /** + * Sample code: List services in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listServicesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.services().listByMobileNetwork("testResourceGroupName", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesUpdateTagsSamples.java new file mode 100644 index 000000000000..f3d476c35bc8 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/ServicesUpdateTagsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Service; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services UpdateTags. */ +public final class ServicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/ServiceUpdateTags.json + */ + /** + * Sample code: Update service tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateServiceTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Service resource = + manager.services().getWithResponse("rg1", "testMobileNetwork", "TestService", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c9d8d4519b7d --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.Ambr; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworkConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.DataNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.PduSessionType; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionCapability; +import com.azure.resourcemanager.mobilenetwork.models.PreemptionVulnerability; +import com.azure.resourcemanager.mobilenetwork.models.ServiceResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SliceConfiguration; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import java.util.Arrays; + +/** Samples for SimPolicies CreateOrUpdate. */ +public final class SimPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyCreate.json + */ + /** + * Sample code: Create sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .simPolicies() + .define("testPolicy") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withUeAmbr(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps")) + .withDefaultSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withSliceConfigurations( + Arrays + .asList( + new SliceConfiguration() + .withSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withDefaultDataNetwork( + new DataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/dataNetworks/testdataNetwork")) + .withDataNetworkConfigurations( + Arrays + .asList( + new DataNetworkConfiguration() + .withDataNetwork( + new DataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/dataNetworks/testdataNetwork")) + .withSessionAmbr(new Ambr().withUplink("500 Mbps").withDownlink("1 Gbps")) + .withFiveQi(9) + .withAllocationAndRetentionPriorityLevel(9) + .withPreemptionCapability(PreemptionCapability.NOT_PREEMPT) + .withPreemptionVulnerability(PreemptionVulnerability.PREEMPTABLE) + .withDefaultSessionType(PduSessionType.IPV4) + .withAdditionalAllowedSessionTypes(Arrays.asList()) + .withAllowedServices( + Arrays + .asList( + new ServiceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/services/testService"))))))) + .withRegistrationTimer(3240) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteSamples.java new file mode 100644 index 000000000000..9d365c5390e7 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for SimPolicies Delete. */ +public final class SimPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyDelete.json + */ + /** + * Sample code: Delete sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().delete("rg1", "testMobileNetwork", "testPolicy", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetSamples.java new file mode 100644 index 000000000000..6e4b6dfbcd49 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for SimPolicies Get. */ +public final class SimPoliciesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyGet.json + */ + /** + * Sample code: Get sim policy. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getSimPolicy(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().getWithResponse("rg1", "testMobileNetwork", "testPolicy", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkSamples.java new file mode 100644 index 000000000000..1cb9ce876934 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesListByMobileNetworkSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for SimPolicies ListByMobileNetwork. */ +public final class SimPoliciesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyListByMobileNetwork.json + */ + /** + * Sample code: List sim policies in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimPoliciesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.simPolicies().listByMobileNetwork("testResourceGroupName", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesUpdateTagsSamples.java new file mode 100644 index 000000000000..1faa88d43794 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimPoliciesUpdateTagsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SimPolicies UpdateTags. */ +public final class SimPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimPolicyUpdateTags.json + */ + /** + * Sample code: Update sim policy tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateSimPolicyTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + SimPolicy resource = + manager.simPolicies().getWithResponse("rg1", "testMobileNetwork", "testPolicy", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..516b955160ec --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.AttachedDataNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimPolicyResourceId; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpProperties; +import com.azure.resourcemanager.mobilenetwork.models.SimStaticIpPropertiesStaticIp; +import com.azure.resourcemanager.mobilenetwork.models.SliceResourceId; +import java.util.Arrays; + +/** Samples for Sims CreateOrUpdate. */ +public final class SimsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimCreate.json + */ + /** + * Sample code: Create sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .sims() + .define("testSim") + .withRegion("testLocation") + .withExistingResourceGroup("rg1") + .withInternationalMobileSubscriberIdentity("00000") + .withIntegratedCircuitCardIdentifier("8900000000000000000") + .withAuthenticationKey("00000000000000000000000000000000") + .withOperatorKeyCode("00000000000000000000000000000000") + .withMobileNetwork( + new MobileNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork")) + .withDeviceType("Video camera") + .withSimPolicy( + new SimPolicyResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/simPolicies/MySimPolicy")) + .withStaticIpConfiguration( + Arrays + .asList( + new SimStaticIpProperties() + .withAttachedDataNetwork( + new AttachedDataNetworkResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/TestPacketCoreCP/packetCoreDataPlanes/TestPacketCoreDP/attachedDataNetworks/TestAttachedDataNetwork")) + .withSlice( + new SliceResourceId() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.MobileNetwork/mobileNetworks/testMobileNetwork/slices/testSlice")) + .withStaticIp(new SimStaticIpPropertiesStaticIp().withIpv4Address("2.4.0.1")))) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteSamples.java new file mode 100644 index 000000000000..f78bd98fe146 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sims Delete. */ +public final class SimsDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimDelete.json + */ + /** + * Sample code: Delete sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().delete("testResourceGroupName", "testSim", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsGetByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..96c0fcd25db3 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sims GetByResourceGroup. */ +public final class SimsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimGet.json + */ + /** + * Sample code: Get sim. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getSim(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().getByResourceGroupWithResponse("testResourceGroupName", "testSimName", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListByResourceGroupSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListByResourceGroupSamples.java new file mode 100644 index 000000000000..5a41ce072249 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sims ListByResourceGroup. */ +public final class SimsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListByResourceGroup.json + */ + /** + * Sample code: List sims in a resource group. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimsInAResourceGroup(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListSamples.java new file mode 100644 index 000000000000..b2263fa61b60 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sims List. */ +public final class SimsListSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimListBySubscription.json + */ + /** + * Sample code: List sims in a subscription. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listSimsInASubscription(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sims().list(Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsUpdateTagsSamples.java new file mode 100644 index 000000000000..41e3d8c26ffc --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SimsUpdateTagsSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Sim; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sims UpdateTags. */ +public final class SimsUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SimUpdateTags.json + */ + /** + * Sample code: Update sim tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateSimTags(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Sim resource = manager.sims().getByResourceGroupWithResponse("rg1", "testSim", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b6ef22c4e925 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.management.SubResource; +import java.util.Arrays; + +/** Samples for Sites CreateOrUpdate. */ +public final class SitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteCreate.json + */ + /** + * Sample code: Create mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .sites() + .define("testSite") + .withRegion("testLocation") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withNetworkFunctions( + Arrays + .asList( + new SubResource() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/networkFunctions/testNf"))) + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteSamples.java new file mode 100644 index 000000000000..293c8d7c959b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sites Delete. */ +public final class SitesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteDelete.json + */ + /** + * Sample code: Delete mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().delete("rg1", "testMobileNetwork", "testSite", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetSamples.java new file mode 100644 index 000000000000..2e5f6ab2d3ad --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sites Get. */ +public final class SitesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteGet.json + */ + /** + * Sample code: Get mobile network site. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkSite(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().getWithResponse("rg1", "testMobileNetwork", "testSite", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkSamples.java new file mode 100644 index 000000000000..0fbf1d41246b --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesListByMobileNetworkSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Sites ListByMobileNetwork. */ +public final class SitesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteListByMobileNetwork.json + */ + /** + * Sample code: List mobile network sites in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkSitesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.sites().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesUpdateTagsSamples.java new file mode 100644 index 000000000000..5a2aa3b1dc67 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SitesUpdateTagsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Site; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Sites UpdateTags. */ +public final class SitesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SiteUpdateTags.json + */ + /** + * Sample code: Update mobile network site tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkSiteTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Site resource = + manager.sites().getWithResponse("rg1", "testMobileNetwork", "testSite", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8ad8604f6ff2 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.resourcemanager.mobilenetwork.models.Snssai; + +/** Samples for Slices CreateOrUpdate. */ +public final class SlicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceCreate.json + */ + /** + * Sample code: Create mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void createMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager + .slices() + .define("testSlice") + .withRegion("eastus") + .withExistingMobileNetwork("rg1", "testMobileNetwork") + .withSnssai(new Snssai().withSst(1).withSd("1abcde")) + .withDescription("myFavouriteSlice") + .create(); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteSamples.java new file mode 100644 index 000000000000..d92110dc0750 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Slices Delete. */ +public final class SlicesDeleteSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceDelete.json + */ + /** + * Sample code: Delete mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void deleteMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().delete("rg1", "testMobileNetwork", "testSlice", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetSamples.java new file mode 100644 index 000000000000..6682097d31c8 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Slices Get. */ +public final class SlicesGetSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceGet.json + */ + /** + * Sample code: Get mobile network slice. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void getMobileNetworkSlice(com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().getWithResponse("rg1", "testMobileNetwork", "testSlice", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkSamples.java new file mode 100644 index 000000000000..3ae1e235d360 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesListByMobileNetworkSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Slices ListByMobileNetwork. */ +public final class SlicesListByMobileNetworkSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceListByMobileNetwork.json + */ + /** + * Sample code: List mobile network slices in a mobile network. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void listMobileNetworkSlicesInAMobileNetwork( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + manager.slices().listByMobileNetwork("rg1", "testMobileNetwork", Context.NONE); + } +} diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesUpdateTagsSamples.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesUpdateTagsSamples.java new file mode 100644 index 000000000000..6cd52a819b68 --- /dev/null +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/samples/java/com/azure/resourcemanager/mobilenetwork/generated/SlicesUpdateTagsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mobilenetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mobilenetwork.models.Slice; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Slices UpdateTags. */ +public final class SlicesUpdateTagsSamples { + /* + * x-ms-original-file: specification/mobilenetwork/resource-manager/Microsoft.MobileNetwork/preview/2022-01-01-preview/examples/SliceUpdateTags.json + */ + /** + * Sample code: Update mobile network slice tags. + * + * @param manager Entry point to MobileNetworkManager. + */ + public static void updateMobileNetworkSliceTags( + com.azure.resourcemanager.mobilenetwork.MobileNetworkManager manager) { + Slice resource = + manager.slices().getWithResponse("rg1", "testMobileNetwork", "testSlice", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/mobilenetwork/ci.yml b/sdk/mobilenetwork/ci.yml new file mode 100644 index 000000000000..45c8b1f71294 --- /dev/null +++ b/sdk/mobilenetwork/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.yml + - sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/ + exclude: + - sdk/mobilenetwork/pom.xml + - sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.yml + - sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/ + exclude: + - sdk/mobilenetwork/pom.xml + - sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: mobilenetwork + Artifacts: + - name: azure-resourcemanager-mobilenetwork + groupId: com.azure.resourcemanager + safeName: azureresourcemanagermobilenetwork diff --git a/sdk/mobilenetwork/pom.xml b/sdk/mobilenetwork/pom.xml new file mode 100644 index 000000000000..e68c0621150d --- /dev/null +++ b/sdk/mobilenetwork/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-mobilenetwork-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-mobilenetwork + + + +