diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c434d9a91d5a..9e0164990432 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -410,6 +410,7 @@ com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-managednetworkfabric;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f893e1394407..3024c2526dac 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,7 @@ sdk/machinelearningservices sdk/maintenance sdk/managedapplications + sdk/managednetworkfabric sdk/maps sdk/mariadb sdk/marketplaceordering diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md new file mode 100644 index 000000000000..dff5bfe08109 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-05-08) + +- Azure Resource Manager managednetworkfabric client library for Java. This package contains Microsoft Azure SDK for managednetworkfabric Management SDK. Self service experience for Azure Network Fabric API. Package tag package-2023-02-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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md new file mode 100644 index 000000000000..ca2a5b4e8fd4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager managednetworkfabric client library for Java + +Azure Resource Manager managednetworkfabric client library for Java. + +This package contains Microsoft Azure SDK for managednetworkfabric Management SDK. Self service experience for Azure Network Fabric API. Package tag package-2023-02-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-managednetworkfabric;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-managednetworkfabric + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ManagednetworkfabricManager manager = ManagednetworkfabricManager + .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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md new file mode 100644 index 000000000000..ed2314edc815 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md @@ -0,0 +1,3668 @@ +# Code snippets and samples + + +## AccessControlLists + +- [Create](#accesscontrollists_create) +- [Delete](#accesscontrollists_delete) +- [GetByResourceGroup](#accesscontrollists_getbyresourcegroup) +- [List](#accesscontrollists_list) +- [ListByResourceGroup](#accesscontrollists_listbyresourcegroup) +- [Update](#accesscontrollists_update) + +## ExternalNetworks + +- [ClearArpEntries](#externalnetworks_cleararpentries) +- [ClearIpv6Neighbors](#externalnetworks_clearipv6neighbors) +- [Create](#externalnetworks_create) +- [Delete](#externalnetworks_delete) +- [Get](#externalnetworks_get) +- [List](#externalnetworks_list) +- [Update](#externalnetworks_update) +- [UpdateAdministrativeState](#externalnetworks_updateadministrativestate) +- [UpdateBfdForBgpAdministrativeState](#externalnetworks_updatebfdforbgpadministrativestate) +- [UpdateBgpAdministrativeState](#externalnetworks_updatebgpadministrativestate) + +## InternalNetworks + +- [ClearArpEntries](#internalnetworks_cleararpentries) +- [ClearIpv6Neighbors](#internalnetworks_clearipv6neighbors) +- [Create](#internalnetworks_create) +- [Delete](#internalnetworks_delete) +- [Get](#internalnetworks_get) +- [List](#internalnetworks_list) +- [Update](#internalnetworks_update) +- [UpdateAdministrativeState](#internalnetworks_updateadministrativestate) +- [UpdateBfdForBgpAdministrativeState](#internalnetworks_updatebfdforbgpadministrativestate) +- [UpdateBfdForStaticRouteAdministrativeState](#internalnetworks_updatebfdforstaticrouteadministrativestate) +- [UpdateBgpAdministrativeState](#internalnetworks_updatebgpadministrativestate) + +## IpCommunityLists + +- [Create](#ipcommunitylists_create) +- [Delete](#ipcommunitylists_delete) +- [GetByResourceGroup](#ipcommunitylists_getbyresourcegroup) +- [List](#ipcommunitylists_list) +- [ListByResourceGroup](#ipcommunitylists_listbyresourcegroup) +- [Update](#ipcommunitylists_update) + +## IpPrefixLists + +- [Create](#ipprefixlists_create) +- [Delete](#ipprefixlists_delete) +- [GetByResourceGroup](#ipprefixlists_getbyresourcegroup) +- [List](#ipprefixlists_list) +- [ListByResourceGroup](#ipprefixlists_listbyresourcegroup) +- [Update](#ipprefixlists_update) + +## L2IsolationDomains + +- [ClearArpTable](#l2isolationdomains_cleararptable) +- [ClearNeighborTable](#l2isolationdomains_clearneighbortable) +- [Create](#l2isolationdomains_create) +- [Delete](#l2isolationdomains_delete) +- [GetArpEntries](#l2isolationdomains_getarpentries) +- [GetByResourceGroup](#l2isolationdomains_getbyresourcegroup) +- [List](#l2isolationdomains_list) +- [ListByResourceGroup](#l2isolationdomains_listbyresourcegroup) +- [Update](#l2isolationdomains_update) +- [UpdateAdministrativeState](#l2isolationdomains_updateadministrativestate) + +## L3IsolationDomains + +- [ClearArpTable](#l3isolationdomains_cleararptable) +- [ClearNeighborTable](#l3isolationdomains_clearneighbortable) +- [Create](#l3isolationdomains_create) +- [Delete](#l3isolationdomains_delete) +- [GetByResourceGroup](#l3isolationdomains_getbyresourcegroup) +- [List](#l3isolationdomains_list) +- [ListByResourceGroup](#l3isolationdomains_listbyresourcegroup) +- [Update](#l3isolationdomains_update) +- [UpdateAdministrativeState](#l3isolationdomains_updateadministrativestate) +- [UpdateOptionBAdministrativeState](#l3isolationdomains_updateoptionbadministrativestate) + +## NetworkDeviceSkus + +- [Get](#networkdeviceskus_get) +- [List](#networkdeviceskus_list) + +## NetworkDevices + +- [Create](#networkdevices_create) +- [Delete](#networkdevices_delete) +- [GenerateSupportPackage](#networkdevices_generatesupportpackage) +- [GetByResourceGroup](#networkdevices_getbyresourcegroup) +- [GetDynamicInterfaceMaps](#networkdevices_getdynamicinterfacemaps) +- [GetStaticInterfaceMaps](#networkdevices_getstaticinterfacemaps) +- [GetStatus](#networkdevices_getstatus) +- [List](#networkdevices_list) +- [ListByResourceGroup](#networkdevices_listbyresourcegroup) +- [Reboot](#networkdevices_reboot) +- [RestoreConfig](#networkdevices_restoreconfig) +- [Update](#networkdevices_update) +- [UpdatePowerCycle](#networkdevices_updatepowercycle) +- [UpdateVersion](#networkdevices_updateversion) + +## NetworkFabricControllers + +- [Create](#networkfabriccontrollers_create) +- [Delete](#networkfabriccontrollers_delete) +- [DisableWorkloadManagementNetwork](#networkfabriccontrollers_disableworkloadmanagementnetwork) +- [EnableWorkloadManagementNetwork](#networkfabriccontrollers_enableworkloadmanagementnetwork) +- [GetByResourceGroup](#networkfabriccontrollers_getbyresourcegroup) +- [List](#networkfabriccontrollers_list) +- [ListByResourceGroup](#networkfabriccontrollers_listbyresourcegroup) +- [Update](#networkfabriccontrollers_update) + +## NetworkFabricSkus + +- [Get](#networkfabricskus_get) +- [List](#networkfabricskus_list) + +## NetworkFabrics + +- [Create](#networkfabrics_create) +- [Delete](#networkfabrics_delete) +- [Deprovision](#networkfabrics_deprovision) +- [GetByResourceGroup](#networkfabrics_getbyresourcegroup) +- [List](#networkfabrics_list) +- [ListByResourceGroup](#networkfabrics_listbyresourcegroup) +- [Provision](#networkfabrics_provision) +- [Update](#networkfabrics_update) + +## NetworkInterfaces + +- [Create](#networkinterfaces_create) +- [Delete](#networkinterfaces_delete) +- [Get](#networkinterfaces_get) +- [GetStatus](#networkinterfaces_getstatus) +- [List](#networkinterfaces_list) +- [Update](#networkinterfaces_update) +- [UpdateAdministrativeState](#networkinterfaces_updateadministrativestate) + +## NetworkRackSkus + +- [Get](#networkrackskus_get) +- [List](#networkrackskus_list) + +## NetworkRacks + +- [Create](#networkracks_create) +- [Delete](#networkracks_delete) +- [GetByResourceGroup](#networkracks_getbyresourcegroup) +- [List](#networkracks_list) +- [ListByResourceGroup](#networkracks_listbyresourcegroup) +- [Update](#networkracks_update) + +## NetworkToNetworkInterconnects + +- [Create](#networktonetworkinterconnects_create) +- [Delete](#networktonetworkinterconnects_delete) +- [Get](#networktonetworkinterconnects_get) +- [List](#networktonetworkinterconnects_list) + +## Operations + +- [List](#operations_list) + +## RoutePolicies + +- [Create](#routepolicies_create) +- [Delete](#routepolicies_delete) +- [GetByResourceGroup](#routepolicies_getbyresourcegroup) +- [List](#routepolicies_list) +- [ListByResourceGroup](#routepolicies_listbyresourcegroup) +- [Update](#routepolicies_update) +### AccessControlLists_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ConditionActionType; +import java.util.Arrays; + +/** Samples for AccessControlLists Create. */ +public final class AccessControlListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .define("aclOne") + .withRegion("EastUs") + .withExistingResourceGroup("resourceGroupName") + .withAddressFamily(AddressFamily.IPV4) + .withConditions( + Arrays + .asList( + new AccessControlListPropertiesConditionsItem() + .withSequenceNumber(3) + .withAction(ConditionActionType.ALLOW) + .withDestinationAddress("1.1.1.1") + .withDestinationPort("21") + .withSourceAddress("2.2.2.2") + .withSourcePort("65000") + .withProtocol(6))) + .create(); + } +} +``` + +### AccessControlLists_Delete + +```java +/** Samples for AccessControlLists Delete. */ +public final class AccessControlListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .deleteByResourceGroupWithResponse("subscriptionId", "aclOne", com.azure.core.util.Context.NONE); + } +} +``` + +### AccessControlLists_GetByResourceGroup + +```java +/** Samples for AccessControlLists GetByResourceGroup. */ +public final class AccessControlListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .getByResourceGroupWithResponse("resourceGroupName", "aclOne", com.azure.core.util.Context.NONE); + } +} +``` + +### AccessControlLists_List + +```java +/** Samples for AccessControlLists List. */ +public final class AccessControlListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.accessControlLists().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AccessControlLists_ListByResourceGroup + +```java +/** Samples for AccessControlLists ListByResourceGroup. */ +public final class AccessControlListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.accessControlLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### AccessControlLists_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ConditionActionType; +import java.util.Arrays; + +/** Samples for AccessControlLists Update. */ +public final class AccessControlListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + AccessControlList resource = + manager + .accessControlLists() + .getByResourceGroupWithResponse("resourceGroupName", "aclOne", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withAddressFamily(AddressFamily.IPV4) + .withConditionsForUpdate( + Arrays + .asList( + new AccessControlListPatchPropertiesConditionsItem() + .withSequenceNumber(4) + .withAction(ConditionActionType.ALLOW) + .withDestinationAddress("1.1.1.2") + .withDestinationPort("21") + .withSourceAddress("2.2.2.3") + .withSourcePort("65000") + .withProtocol(6))) + .apply(); + } +} +``` + +### ExternalNetworks_ClearArpEntries + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for ExternalNetworks ClearArpEntries. */ +public final class ExternalNetworksClearArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_clearArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksClearArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .clearArpEntries( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_ClearIpv6Neighbors + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for ExternalNetworks ClearIpv6Neighbors. */ +public final class ExternalNetworksClearIpv6NeighborsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_clearIpv6Neighbors_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksClearIpv6NeighborsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .clearIpv6Neighbors( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for ExternalNetworks Create. */ +public final class ExternalNetworksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .define("example-externalnetwork") + .withExistingL3IsolationDomain("resourceGroupName", "example-l3domain") + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBProperties() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new ExternalNetworkPropertiesOptionAProperties() + .withPrimaryIpv4Prefix("10.1.1.0/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("10.1.1.4/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withMtu(1500) + .withVlanId(1001) + .withPeerAsn(65047) + .withBfdConfiguration(new BfdConfiguration())) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .create(); + } +} +``` + +### ExternalNetworks_Delete + +```java +/** Samples for ExternalNetworks Delete. */ +public final class ExternalNetworksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .delete( + "resourceGroupName", "example-l3domain", "example-externalnetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_Get + +```java +/** Samples for ExternalNetworks Get. */ +public final class ExternalNetworksGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .getWithResponse( + "resourceGroupName", "example-l3domain", "example-externalnetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_List + +```java +/** Samples for ExternalNetworks List. */ +public final class ExternalNetworksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_List_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.externalNetworks().list("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for ExternalNetworks Update. */ +public final class ExternalNetworksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + ExternalNetwork resource = + manager + .externalNetworks() + .getWithResponse( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBProperties() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new OptionAProperties() + .withPrimaryIpv4Prefix("10.1.1.0/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("10.1.1.4/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withMtu(1500) + .withVlanId(1001) + .withPeerAsn(65047) + .withBfdConfiguration(new BfdConfiguration())) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withAnnotation("Lab 1") + .apply(); + } +} +``` + +### ExternalNetworks_UpdateAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateAdministrativeState. */ +public final class ExternalNetworksUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_UpdateBfdForBgpAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateBfdForBgpAdministrativeState. */ +public final class ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateBfdForBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateBfdForBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExternalNetworks_UpdateBgpAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateBgpAdministrativeState. */ +public final class ExternalNetworksUpdateBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_ClearArpEntries + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for InternalNetworks ClearArpEntries. */ +public final class InternalNetworksClearArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_clearArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksClearArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .clearArpEntries( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_ClearIpv6Neighbors + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for InternalNetworks ClearIpv6Neighbors. */ +public final class InternalNetworksClearIpv6NeighborsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_clearIpv6Neighbors_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksClearIpv6NeighborsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .clearIpv6Neighbors( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem; +import java.util.Arrays; + +/** Samples for InternalNetworks Create. */ +public final class InternalNetworksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .define("example-internalnetwork") + .withExistingL3IsolationDomain("resourceGroupName", "example-l3domain") + .withVlanId(501) + .withMtu(1500) + .withConnectedIPv4Subnets( + Arrays + .asList(new InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets( + Arrays + .asList( + new InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new InternalNetworkPatchablePropertiesStaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new InternalNetworkPatchablePropertiesBgpConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) + .withAllowAS(1) + .withAllowASOverride(AllowASOverride.ENABLE) + .withPeerAsn(6) + .withIpv4ListenRangePrefixes(Arrays.asList("10.1.0.0/25")) + .withIpv6ListenRangePrefixes(Arrays.asList("2fff::/66")) + .withIpv4NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem() + .withAddress("10.1.0.0"))) + .withIpv6NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem() + .withAddress("2fff::")))) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .create(); + } +} +``` + +### InternalNetworks_Delete + +```java +/** Samples for InternalNetworks Delete. */ +public final class InternalNetworksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .delete( + "resourceGroupName", "example-l3domain", "example-internalnetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_Get + +```java +/** Samples for InternalNetworks Get. */ +public final class InternalNetworksGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .getWithResponse( + "resourceGroupName", "example-l3domain", "example-internalnetwork", com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_List + +```java +/** Samples for InternalNetworks List. */ +public final class InternalNetworksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_List_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.internalNetworks().list("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem; +import java.util.Arrays; + +/** Samples for InternalNetworks Update. */ +public final class InternalNetworksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + InternalNetwork resource = + manager + .internalNetworks() + .getWithResponse( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withMtu(1500) + .withConnectedIPv4Subnets( + Arrays + .asList(new InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets( + Arrays + .asList( + new InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new InternalNetworkPatchablePropertiesStaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new InternalNetworkPatchablePropertiesBgpConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) + .withAllowAS(1) + .withAllowASOverride(AllowASOverride.ENABLE) + .withPeerAsn(6) + .withIpv4ListenRangePrefixes(Arrays.asList("10.1.0.0/25")) + .withIpv6ListenRangePrefixes(Arrays.asList("2fff::/66")) + .withIpv4NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem() + .withAddress("10.1.0.0"))) + .withIpv6NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem() + .withAddress("2fff::")))) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .apply(); + } +} +``` + +### InternalNetworks_UpdateAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateAdministrativeState. */ +public final class InternalNetworksUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_UpdateBfdForBgpAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBfdForBgpAdministrativeState. */ +public final class InternalNetworksUpdateBfdForBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBfdForBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBfdForBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_UpdateBfdForStaticRouteAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBfdForStaticRouteAdministrativeState. */ +public final class InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForStaticRouteAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBfdForStaticRouteAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBfdForStaticRouteAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBfdForStaticRouteAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### InternalNetworks_UpdateBgpAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBgpAdministrativeState. */ +public final class InternalNetworksUpdateBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunityLists_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunityLists Create. */ +public final class IpCommunityListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .define("aaaaa") + .withRegion("EastUS") + .withExistingResourceGroup("rgIpCommunityLists") + .withTags(mapOf("key2814", "")) + .withAction(CommunityActionType.ALLOW) + .withLocalAS(LocalASBoolean.TRUE) + .withAdvertise(AdvertiseBoolean.TRUE) + .withExport(ExportBoolean.TRUE) + .withCommunityMembers( + Arrays + .asList( + new IpCommunityListPropertiesCommunityMembersItem() + .withAnnotation("app2") + .withCommunityMember("1234:5678"))) + .withEvpnEsImportRouteTargets( + Arrays + .asList( + new IpCommunityListPropertiesEvpnEsImportRouteTargetsItem() + .withAnnotation("app1") + .withEvpnEsImportRouteTarget("1.1.1"))) + .withAnnotation("aaaa") + .create(); + } + + @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; + } +} +``` + +### IpCommunityLists_Delete + +```java +/** Samples for IpCommunityLists Delete. */ +public final class IpCommunityListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .deleteByResourceGroupWithResponse( + "resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunityLists_GetByResourceGroup + +```java +/** Samples for IpCommunityLists GetByResourceGroup. */ +public final class IpCommunityListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunityLists_List + +```java +/** Samples for IpCommunityLists List. */ +public final class IpCommunityListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunityLists().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunityLists_ListByResourceGroup + +```java +/** Samples for IpCommunityLists ListByResourceGroup. */ +public final class IpCommunityListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunityLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunityLists_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityList; + +/** Samples for IpCommunityLists Update. */ +public final class IpCommunityListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpCommunityList resource = + manager + .ipCommunityLists() + .getByResourceGroupWithResponse( + "resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### IpPrefixLists_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.PrefixActionType; + +/** Samples for IpPrefixLists Create. */ +public final class IpPrefixListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .define("IpPrefixList1") + .withRegion("EastUS") + .withExistingResourceGroup("resourceGroupName") + .withAction(PrefixActionType.ALLOW) + .withSequenceNumber(19) + .withNetworkAddress("1.1.1.0/24") + .create(); + } +} +``` + +### IpPrefixLists_Delete + +```java +/** Samples for IpPrefixLists Delete. */ +public final class IpPrefixListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .deleteByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixLists_GetByResourceGroup + +```java +/** Samples for IpPrefixLists GetByResourceGroup. */ +public final class IpPrefixListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixLists_List + +```java +/** Samples for IpPrefixLists List. */ +public final class IpPrefixListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixLists().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixLists_ListByResourceGroup + +```java +/** Samples for IpPrefixLists ListByResourceGroup. */ +public final class IpPrefixListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixLists_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixList; + +/** Samples for IpPrefixLists Update. */ +public final class IpPrefixListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpPrefixList resource = + manager + .ipPrefixLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### L2IsolationDomains_ClearArpTable + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L2IsolationDomains ClearArpTable. */ +public final class L2IsolationDomainsClearArpTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearArpTable_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_clearArpTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsClearArpTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .clearArpTable( + "resourceGroupName", + "example-l2domain", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_ClearNeighborTable + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L2IsolationDomains ClearNeighborTable. */ +public final class L2IsolationDomainsClearNeighborTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearNeighborTable_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_clearNeighborTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsClearNeighborTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .clearNeighborTable( + "rgL2IsolationDomains", + "oz", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_Create + +```java +/** Samples for L2IsolationDomains Create. */ +public final class L2IsolationDomainsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Create_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .define("example-l2domain") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricId( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName") + .withVlanId(501) + .withMtu(1500) + .create(); + } +} +``` + +### L2IsolationDomains_Delete + +```java +/** Samples for L2IsolationDomains Delete. */ +public final class L2IsolationDomainsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().delete("resourceGroupName", "example-l2domain", com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_GetArpEntries + +```java +/** Samples for L2IsolationDomains GetArpEntries. */ +public final class L2IsolationDomainsGetArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_getArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_getArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsGetArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .getArpEntries("resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_GetByResourceGroup + +```java +/** Samples for L2IsolationDomains GetByResourceGroup. */ +public final class L2IsolationDomainsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_List + +```java +/** Samples for L2IsolationDomains List. */ +public final class L2IsolationDomainsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().list(com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_ListByResourceGroup + +```java +/** Samples for L2IsolationDomains ListByResourceGroup. */ +public final class L2IsolationDomainsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2IsolationDomains_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; + +/** Samples for L2IsolationDomains Update. */ +public final class L2IsolationDomainsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Update_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + L2IsolationDomain resource = + manager + .l2IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withMtu(9000).apply(); + } +} +``` + +### L2IsolationDomains_UpdateAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L2IsolationDomains UpdateAdministrativeState. */ +public final class L2IsolationDomainsUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .updateAdministrativeState( + "resourceGroupName", + "l2IsolationDomainName", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_ClearArpTable + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L3IsolationDomains ClearArpTable. */ +public final class L3IsolationDomainsClearArpTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearArpTable_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_clearArpTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsClearArpTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .clearArpTable( + "resourceGroupName", + "l3IsolationDomainName", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_ClearNeighborTable + +```java +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L3IsolationDomains ClearNeighborTable. */ +public final class L3IsolationDomainsClearNeighborTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearNeighborTable_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_clearNeighborTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsClearNeighborTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .clearNeighborTable( + "resourceGroupName", + "example-l3domain", + new EnableDisableOnResources().withResourceIds(Arrays.asList("wnaxqikneofcni")), + com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import java.util.Arrays; + +/** Samples for L3IsolationDomains Create. */ +public final class L3IsolationDomainsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Create_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .define("example-l3domain") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricId( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName") + .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) + .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) + .withAggregateRouteConfiguration( + new L3IsolationDomainPatchPropertiesAggregateRouteConfiguration() + .withIpv4Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem() + .withPrefix("10.0.0.0/24"))) + .withIpv6Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem() + .withPrefix("10.0.0.1")))) + .withDescription("creating L3 isolation domain") + .withConnectedSubnetRoutePolicy( + new L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy() + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2")) + .create(); + } +} +``` + +### L3IsolationDomains_Delete + +```java +/** Samples for L3IsolationDomains Delete. */ +public final class L3IsolationDomainsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().delete("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_GetByResourceGroup + +```java +/** Samples for L3IsolationDomains GetByResourceGroup. */ +public final class L3IsolationDomainsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .getByResourceGroupWithResponse("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_List + +```java +/** Samples for L3IsolationDomains List. */ +public final class L3IsolationDomainsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().list(com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_ListByResourceGroup + +```java +/** Samples for L3IsolationDomains ListByResourceGroup. */ +public final class L3IsolationDomainsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import java.util.Arrays; + +/** Samples for L3IsolationDomains Update. */ +public final class L3IsolationDomainsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Update_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + L3IsolationDomain resource = + manager + .l3IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) + .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) + .withAggregateRouteConfiguration( + new L3IsolationDomainPatchPropertiesAggregateRouteConfiguration() + .withIpv4Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem() + .withPrefix("10.0.0.0/24"))) + .withIpv6Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29")))) + .withDescription("creating L3 isolation domain") + .withConnectedSubnetRoutePolicy( + new L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy() + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName")) + .apply(); + } +} +``` + +### L3IsolationDomains_UpdateAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L3IsolationDomains UpdateAdministrativeState. */ +public final class L3IsolationDomainsUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### L3IsolationDomains_UpdateOptionBAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L3IsolationDomains UpdateOptionBAdministrativeState. */ +public final class L3IsolationDomainsUpdateOptionBAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateOptionBAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_updateOptionBAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateOptionBAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .updateOptionBAdministrativeState( + "resourceGroupName", + "example-l3domain", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDeviceSkus_Get + +```java +/** Samples for NetworkDeviceSkus Get. */ +public final class NetworkDeviceSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDeviceSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDeviceSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDeviceSkus().getWithResponse("DefaultSku", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDeviceSkus_List + +```java +/** Samples for NetworkDeviceSkus List. */ +public final class NetworkDeviceSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDeviceSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDeviceSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkDevices Create. */ +public final class NetworkDevicesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .define("networkDeviceName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("keyID", "keyValue")) + .withNetworkDeviceSku("DefaultSku") + .withNetworkDeviceRole(NetworkDeviceRoleTypes.CE) + .withHostname("networkDeviceName") + .withSerialNumber("Arista;DCS-7280PR3-24;12.05;JPE21330382") + .withAnnotation("null") + .create(); + } + + @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; + } +} +``` + +### NetworkDevices_Delete + +```java +/** Samples for NetworkDevices Delete. */ +public final class NetworkDevicesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().delete("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_GenerateSupportPackage + +```java +/** Samples for NetworkDevices GenerateSupportPackage. */ +public final class NetworkDevicesGenerateSupportPackageSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_generateSupportPackage_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_generateSupportPackage_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGenerateSupportPackageMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .generateSupportPackage("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_GetByResourceGroup + +```java +/** Samples for NetworkDevices GetByResourceGroup. */ +public final class NetworkDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getByResourceGroupWithResponse("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_GetDynamicInterfaceMaps + +```java +/** Samples for NetworkDevices GetDynamicInterfaceMaps. */ +public final class NetworkDevicesGetDynamicInterfaceMapsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getDynamicInterfaceMaps_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getDynamicInterfaceMaps_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetDynamicInterfaceMapsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getDynamicInterfaceMaps("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_GetStaticInterfaceMaps + +```java +/** Samples for NetworkDevices GetStaticInterfaceMaps. */ +public final class NetworkDevicesGetStaticInterfaceMapsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStaticInterfaceMaps_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getStaticInterfaceMaps_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetStaticInterfaceMapsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getStaticInterfaceMaps("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_GetStatus + +```java +/** Samples for NetworkDevices GetStatus. */ +public final class NetworkDevicesGetStatusSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStatus_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getStatus_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetStatusMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().getStatus("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_List + +```java +/** Samples for NetworkDevices List. */ +public final class NetworkDevicesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_ListByResourceGroup + +```java +/** Samples for NetworkDevices ListByResourceGroup. */ +public final class NetworkDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_Reboot + +```java +/** Samples for NetworkDevices Reboot. */ +public final class NetworkDevicesRebootSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_reboot_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_reboot_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesRebootMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().reboot("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_RestoreConfig + +```java +/** Samples for NetworkDevices RestoreConfig. */ +public final class NetworkDevicesRestoreConfigSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_restoreConfig_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_restoreConfig_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesRestoreConfigMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .restoreConfig("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkDevices Update. */ +public final class NetworkDevicesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkDevice resource = + manager + .networkDevices() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("keyID", "keyValue")) + .withHostname("networkDeviceName") + .withSerialNumber("Arista;DCS-7280PR3-24;12.05;JPE21330382") + .withAnnotation("null") + .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; + } +} +``` + +### NetworkDevices_UpdatePowerCycle + +```java +import com.azure.resourcemanager.managednetworkfabric.models.PowerEnd; +import com.azure.resourcemanager.managednetworkfabric.models.State; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; + +/** Samples for NetworkDevices UpdatePowerCycle. */ +public final class NetworkDevicesUpdatePowerCycleSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updatePowerCycle_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_updatePowerCycle_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdatePowerCycleMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .updatePowerCycle( + "resourceGroupName", + "networkDeviceName", + new UpdatePowerCycleProperties().withPowerEnd(PowerEnd.PRIMARY).withState(State.ON), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkDevices_UpdateVersion + +```java +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; + +/** Samples for NetworkDevices UpdateVersion. */ +public final class NetworkDevicesUpdateVersionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updateVersion_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_updateVersion_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdateVersionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .updateVersion( + "resourceGroupName", + "networkDeviceName", + new UpdateVersionProperties().withSkuVersion("DefaultSku"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesManagedResourceGroupConfiguration; +import java.util.Arrays; + +/** Samples for NetworkFabricControllers Create. */ +public final class NetworkFabricControllersCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .define("NetworkControllerName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withManagedResourceGroupConfiguration( + new NetworkFabricControllerPropertiesManagedResourceGroupConfiguration() + .withName("managedResourceGroupName") + .withLocation("eastus")) + .withIpv4AddressSpace("172.253.0.0/19") + .withInfrastructureExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .withWorkloadExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .withAnnotation("lab 1") + .create(); + } +} +``` + +### NetworkFabricControllers_Delete + +```java +/** Samples for NetworkFabricControllers Delete. */ +public final class NetworkFabricControllersDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .delete("resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_DisableWorkloadManagementNetwork + +```java +/** Samples for NetworkFabricControllers DisableWorkloadManagementNetwork. */ +public final class NetworkFabricControllersDisableWorkloadManagementNetworkSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_disableWorkloadManagementNetwork_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_disableWorkloadManagementNetwork_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersDisableWorkloadManagementNetworkMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .disableWorkloadManagementNetwork( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_EnableWorkloadManagementNetwork + +```java +/** Samples for NetworkFabricControllers EnableWorkloadManagementNetwork. */ +public final class NetworkFabricControllersEnableWorkloadManagementNetworkSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_enableWorkloadManagementNetwork_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_enableWorkloadManagementNetwork_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersEnableWorkloadManagementNetworkMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .enableWorkloadManagementNetwork( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_GetByResourceGroup + +```java +/** Samples for NetworkFabricControllers GetByResourceGroup. */ +public final class NetworkFabricControllersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_List + +```java +/** Samples for NetworkFabricControllers List. */ +public final class NetworkFabricControllersListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricControllers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_ListByResourceGroup + +```java +/** Samples for NetworkFabricControllers ListByResourceGroup. */ +public final class NetworkFabricControllersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricControllers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricControllers_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricController; +import java.util.Arrays; + +/** Samples for NetworkFabricControllers Update. */ +public final class NetworkFabricControllersUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkFabricController resource = + manager + .networkFabricControllers() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withWorkloadExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .apply(); + } +} +``` + +### NetworkFabricSkus_Get + +```java +/** Samples for NetworkFabricSkus Get. */ +public final class NetworkFabricSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricSkus().getWithResponse("networkFabricSkuName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabricSkus_List + +```java +/** Samples for NetworkFabricSkus List. */ +public final class NetworkFabricSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesTerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBPropertiesAutoGenerated; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for NetworkFabrics Create. */ +public final class NetworkFabricsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .define("FabricName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricSku("M4-A400-A100-C16-aa") + .withRackCount(4) + .withServerCountPerRack(8) + .withIpv4Prefix("10.18.0.0/19") + .withIpv6Prefix("3FFE:FFFF:0:CD40::/59") + .withFabricAsn(29249) + .withNetworkFabricControllerId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTerminalServerConfiguration( + new NetworkFabricPropertiesTerminalServerConfiguration() + .withPrimaryIpv4Prefix("20.0.0.12/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a8/126") + .withSecondaryIpv4Prefix("20.0.0.13/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::ac/126") + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("123456")) + .withManagementNetworkConfiguration( + new NetworkFabricPropertiesManagementNetworkConfiguration() + .withInfrastructureVpnConfiguration( + new NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039")))) + .withWorkloadVpnConfiguration( + new NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10050")) + .withExportRouteTargets(Arrays.asList("65046:10050"))))) + .create(); + } +} +``` + +### NetworkFabrics_Delete + +```java +/** Samples for NetworkFabrics Delete. */ +public final class NetworkFabricsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .delete("rgNetworkFabrics", "lrhjxlxlhgvufessdcuetcwnto", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_Deprovision + +```java +/** Samples for NetworkFabrics Deprovision. */ +public final class NetworkFabricsDeprovisionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_deprovision_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsDeprovisionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().deprovision("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_GetByResourceGroup + +```java +/** Samples for NetworkFabrics GetByResourceGroup. */ +public final class NetworkFabricsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .getByResourceGroupWithResponse("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_List + +```java +/** Samples for NetworkFabrics List. */ +public final class NetworkFabricsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_ListByResourceGroup + +```java +/** Samples for NetworkFabrics ListByResourceGroup. */ +public final class NetworkFabricsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().listByResourceGroup("rgNetworkFabrics", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_Provision + +```java +/** Samples for NetworkFabrics Provision. */ +public final class NetworkFabricsProvisionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_provision_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_provision_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsProvisionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().provision("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFabrics_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchParametersTerminalServerConfiguration; + +/** Samples for NetworkFabrics Update. */ +public final class NetworkFabricsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkFabric resource = + manager + .networkFabrics() + .getByResourceGroupWithResponse("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTerminalServerConfiguration( + new TerminalServerPatchParametersTerminalServerConfiguration() + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("234567")) + .apply(); + } +} +``` + +### NetworkInterfaces_Create + +```java +/** Samples for NetworkInterfaces Create. */ +public final class NetworkInterfacesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .define("networkInterfaceName") + .withExistingNetworkDevice("resourceGroupName", "networkDeviceName") + .withAnnotation("null") + .create(); + } +} +``` + +### NetworkInterfaces_Delete + +```java +/** Samples for NetworkInterfaces Delete. */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .delete("resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_Get + +```java +/** Samples for NetworkInterfaces Get. */ +public final class NetworkInterfacesGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .getWithResponse( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetStatus + +```java +/** Samples for NetworkInterfaces GetStatus. */ +public final class NetworkInterfacesGetStatusSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_getStatus_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_getStatus_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesGetStatusMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .getStatus( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_List + +```java +/** Samples for NetworkInterfaces List. */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_List_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkInterfaces().list("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; + +/** Samples for NetworkInterfaces Update. */ +public final class NetworkInterfacesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkInterface resource = + manager + .networkInterfaces() + .getWithResponse( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withAnnotation("null").apply(); + } +} +``` + +### NetworkInterfaces_UpdateAdministrativeState + +```java +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** Samples for NetworkInterfaces UpdateAdministrativeState. */ +public final class NetworkInterfacesUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .updateAdministrativeState( + "resourceGroupName", + "networkDeviceName", + "networkInterfaceName", + new UpdateAdministrativeState().withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRackSkus_Get + +```java +/** Samples for NetworkRackSkus Get. */ +public final class NetworkRackSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRackSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRackSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRackSkus().getWithResponse("networkRackSkuName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRackSkus_List + +```java +/** Samples for NetworkRackSkus List. */ +public final class NetworkRackSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRackSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRackSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRackSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRacks_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkRacks Create. */ +public final class NetworkRacksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkRacks() + .define("networkRackName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkRackSku("RackSKU") + .withNetworkFabricId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName") + .withTags(mapOf("keyID", "keyValue")) + .withAnnotation("null") + .create(); + } + + @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; + } +} +``` + +### NetworkRacks_Delete + +```java +/** Samples for NetworkRacks Delete. */ +public final class NetworkRacksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().delete("resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRacks_GetByResourceGroup + +```java +/** Samples for NetworkRacks GetByResourceGroup. */ +public final class NetworkRacksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkRacks() + .getByResourceGroupWithResponse("resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRacks_List + +```java +/** Samples for NetworkRacks List. */ +public final class NetworkRacksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRacks_ListByResourceGroup + +```java +/** Samples for NetworkRacks ListByResourceGroup. */ +public final class NetworkRacksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkRacks_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkRacks Update. */ +public final class NetworkRacksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) throws IOException { + NetworkRack resource = + manager + .networkRacks() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("keyID", "keyValue")) + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .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; + } +} +``` + +### NetworkToNetworkInterconnects_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesLayer2Configuration; + +/** Samples for NetworkToNetworkInterconnects Create. */ +public final class NetworkToNetworkInterconnectsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .define("DefaultNNI") + .withExistingNetworkFabric("resourceGroupName", "FabricName") + .withIsManagementType(BooleanEnumProperty.TRUE) + .withUseOptionB(BooleanEnumProperty.FALSE) + .withLayer2Configuration( + new NetworkToNetworkInterconnectPropertiesLayer2Configuration().withPortCount(10).withMtu(1500)) + .withLayer3Configuration( + new Layer3Configuration() + .withPrimaryIpv4Prefix("172.31.0.0/31") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("172.31.0.20/31") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .withPeerAsn(50272) + .withVlanId(2064)) + .create(); + } +} +``` + +### NetworkToNetworkInterconnects_Delete + +```java +/** Samples for NetworkToNetworkInterconnects Delete. */ +public final class NetworkToNetworkInterconnectsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .delete("resourceGroupName", "FabricName", "DefaultNNI", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkToNetworkInterconnects_Get + +```java +/** Samples for NetworkToNetworkInterconnects Get. */ +public final class NetworkToNetworkInterconnectsGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .getWithResponse("resourceGroupName", "FabricName", "DefaultNNI", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkToNetworkInterconnects_List + +```java +/** Samples for NetworkToNetworkInterconnects List. */ +public final class NetworkToNetworkInterconnectsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_List_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .list("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void listOperations( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RoutePolicies_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItemAction; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItemMatch; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RoutePolicies Create. */ +public final class RoutePoliciesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Create_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .routePolicies() + .define("example RoutePolicy") + .withRegion("EastUS") + .withExistingResourceGroup("rgRoutePolicies") + .withTags(mapOf("key8254", "")) + .withDescription("RPexample") + .withConditions( + Arrays + .asList( + new RoutePolicyPropertiesConditionsItem() + .withAnnotation("") + .withSequenceNumber(7) + .withMatch( + new RoutePolicyPropertiesConditionsItemMatch() + .withAccessControlListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/accessControlLists/accessControlListName")) + .withIpCommunityListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/ipCommunityLists/ipCommunityListName")) + .withIpExtendedCommunityListIds(Arrays.asList(""))) + .withAction( + new RoutePolicyPropertiesConditionsItemAction() + .withAction("allow") + .withSet( + new Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet() + .withSet( + new RoutePolicyPropertiesConditionsProperties() + .withIpCommunityListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/ipCommunityLists/ipCommunityListName")) + .withIpExtendedCommunityListIds(Arrays.asList(""))))))) + .withAnnotation("example routepolicy") + .create(); + } + + @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; + } +} +``` + +### RoutePolicies_Delete + +```java +/** Samples for RoutePolicies Delete. */ +public final class RoutePoliciesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().delete("rgRoutePolicies", "aaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutePolicies_GetByResourceGroup + +```java +/** Samples for RoutePolicies GetByResourceGroup. */ +public final class RoutePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .routePolicies() + .getByResourceGroupWithResponse("rgRoutePolicies", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutePolicies_List + +```java +/** Samples for RoutePolicies List. */ +public final class RoutePoliciesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RoutePolicies_ListByResourceGroup + +```java +/** Samples for RoutePolicies ListByResourceGroup. */ +public final class RoutePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().listByResourceGroup("rgRoutePolicies", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutePolicies_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RoutePolicies Update. */ +public final class RoutePoliciesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) throws IOException { + RoutePolicy resource = + manager + .routePolicies() + .getByResourceGroupWithResponse( + "rgRoutePolicies", "aaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1917", "aaaaaaaaaaaaa")) + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml new file mode 100644 index 000000000000..981b7d35ddee --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-managednetworkfabric + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for managednetworkfabric Management + This package contains Microsoft Azure SDK for managednetworkfabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Self service experience for Azure Network Fabric API. Package tag package-2023-02-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 + 0 + 0 + + + + com.azure + azure-core + 1.39.0 + + + com.azure + azure-core-management + 1.11.1 + + + diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagednetworkfabricManager.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagednetworkfabricManager.java new file mode 100644 index 000000000000..8900be2f258b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagednetworkfabricManager.java @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric; + +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.AddHeadersFromContextPolicy; +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.RetryOptions; +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.managednetworkfabric.fluent.AzureNetworkFabricManagementServiceApi; +import com.azure.resourcemanager.managednetworkfabric.implementation.AccessControlListsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.AzureNetworkFabricManagementServiceApiBuilder; +import com.azure.resourcemanager.managednetworkfabric.implementation.ExternalNetworksImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.InternalNetworksImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.IpCommunityListsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.IpPrefixListsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.L2IsolationDomainsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.L3IsolationDomainsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkDeviceSkusImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkDevicesImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkFabricControllersImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkFabricSkusImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkFabricsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkInterfacesImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkRackSkusImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkRacksImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.NetworkToNetworkInterconnectsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.OperationsImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.RoutePoliciesImpl; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlLists; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworks; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworks; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityLists; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixLists; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomains; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomains; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkus; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevices; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllers; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSkus; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabrics; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfaces; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkus; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRacks; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnects; +import com.azure.resourcemanager.managednetworkfabric.models.Operations; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicies; +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 ManagednetworkfabricManager. Self service experience for Azure Network Fabric API. */ +public final class ManagednetworkfabricManager { + private AccessControlLists accessControlLists; + + private IpCommunityLists ipCommunityLists; + + private IpPrefixLists ipPrefixLists; + + private L2IsolationDomains l2IsolationDomains; + + private L3IsolationDomains l3IsolationDomains; + + private InternalNetworks internalNetworks; + + private ExternalNetworks externalNetworks; + + private NetworkDeviceSkus networkDeviceSkus; + + private NetworkDevices networkDevices; + + private NetworkInterfaces networkInterfaces; + + private NetworkFabricControllers networkFabricControllers; + + private NetworkFabricSkus networkFabricSkus; + + private NetworkFabrics networkFabrics; + + private NetworkToNetworkInterconnects networkToNetworkInterconnects; + + private NetworkRackSkus networkRackSkus; + + private NetworkRacks networkRacks; + + private Operations operations; + + private RoutePolicies routePolicies; + + private final AzureNetworkFabricManagementServiceApi clientObject; + + private ManagednetworkfabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureNetworkFabricManagementServiceApiBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of managednetworkfabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the managednetworkfabric service API instance. + */ + public static ManagednetworkfabricManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of managednetworkfabric service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the managednetworkfabric service API instance. + */ + public static ManagednetworkfabricManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ManagednetworkfabricManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ManagednetworkfabricManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ManagednetworkfabricManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of managednetworkfabric service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the managednetworkfabric service API instance. + */ + public ManagednetworkfabricManager 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.managednetworkfabric") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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 ManagednetworkfabricManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of AccessControlLists. It manages AccessControlList. + * + * @return Resource collection API of AccessControlLists. + */ + public AccessControlLists accessControlLists() { + if (this.accessControlLists == null) { + this.accessControlLists = new AccessControlListsImpl(clientObject.getAccessControlLists(), this); + } + return accessControlLists; + } + + /** + * Gets the resource collection API of IpCommunityLists. It manages IpCommunityList. + * + * @return Resource collection API of IpCommunityLists. + */ + public IpCommunityLists ipCommunityLists() { + if (this.ipCommunityLists == null) { + this.ipCommunityLists = new IpCommunityListsImpl(clientObject.getIpCommunityLists(), this); + } + return ipCommunityLists; + } + + /** + * Gets the resource collection API of IpPrefixLists. It manages IpPrefixList. + * + * @return Resource collection API of IpPrefixLists. + */ + public IpPrefixLists ipPrefixLists() { + if (this.ipPrefixLists == null) { + this.ipPrefixLists = new IpPrefixListsImpl(clientObject.getIpPrefixLists(), this); + } + return ipPrefixLists; + } + + /** + * Gets the resource collection API of L2IsolationDomains. It manages L2IsolationDomain. + * + * @return Resource collection API of L2IsolationDomains. + */ + public L2IsolationDomains l2IsolationDomains() { + if (this.l2IsolationDomains == null) { + this.l2IsolationDomains = new L2IsolationDomainsImpl(clientObject.getL2IsolationDomains(), this); + } + return l2IsolationDomains; + } + + /** + * Gets the resource collection API of L3IsolationDomains. It manages L3IsolationDomain. + * + * @return Resource collection API of L3IsolationDomains. + */ + public L3IsolationDomains l3IsolationDomains() { + if (this.l3IsolationDomains == null) { + this.l3IsolationDomains = new L3IsolationDomainsImpl(clientObject.getL3IsolationDomains(), this); + } + return l3IsolationDomains; + } + + /** + * Gets the resource collection API of InternalNetworks. It manages InternalNetwork. + * + * @return Resource collection API of InternalNetworks. + */ + public InternalNetworks internalNetworks() { + if (this.internalNetworks == null) { + this.internalNetworks = new InternalNetworksImpl(clientObject.getInternalNetworks(), this); + } + return internalNetworks; + } + + /** + * Gets the resource collection API of ExternalNetworks. It manages ExternalNetwork. + * + * @return Resource collection API of ExternalNetworks. + */ + public ExternalNetworks externalNetworks() { + if (this.externalNetworks == null) { + this.externalNetworks = new ExternalNetworksImpl(clientObject.getExternalNetworks(), this); + } + return externalNetworks; + } + + /** + * Gets the resource collection API of NetworkDeviceSkus. + * + * @return Resource collection API of NetworkDeviceSkus. + */ + public NetworkDeviceSkus networkDeviceSkus() { + if (this.networkDeviceSkus == null) { + this.networkDeviceSkus = new NetworkDeviceSkusImpl(clientObject.getNetworkDeviceSkus(), this); + } + return networkDeviceSkus; + } + + /** + * Gets the resource collection API of NetworkDevices. It manages NetworkDevice. + * + * @return Resource collection API of NetworkDevices. + */ + public NetworkDevices networkDevices() { + if (this.networkDevices == null) { + this.networkDevices = new NetworkDevicesImpl(clientObject.getNetworkDevices(), this); + } + return networkDevices; + } + + /** + * Gets the resource collection API of NetworkInterfaces. It manages NetworkInterface. + * + * @return Resource collection API of NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(clientObject.getNetworkInterfaces(), this); + } + return networkInterfaces; + } + + /** + * Gets the resource collection API of NetworkFabricControllers. It manages NetworkFabricController. + * + * @return Resource collection API of NetworkFabricControllers. + */ + public NetworkFabricControllers networkFabricControllers() { + if (this.networkFabricControllers == null) { + this.networkFabricControllers = + new NetworkFabricControllersImpl(clientObject.getNetworkFabricControllers(), this); + } + return networkFabricControllers; + } + + /** + * Gets the resource collection API of NetworkFabricSkus. + * + * @return Resource collection API of NetworkFabricSkus. + */ + public NetworkFabricSkus networkFabricSkus() { + if (this.networkFabricSkus == null) { + this.networkFabricSkus = new NetworkFabricSkusImpl(clientObject.getNetworkFabricSkus(), this); + } + return networkFabricSkus; + } + + /** + * Gets the resource collection API of NetworkFabrics. It manages NetworkFabric. + * + * @return Resource collection API of NetworkFabrics. + */ + public NetworkFabrics networkFabrics() { + if (this.networkFabrics == null) { + this.networkFabrics = new NetworkFabricsImpl(clientObject.getNetworkFabrics(), this); + } + return networkFabrics; + } + + /** + * Gets the resource collection API of NetworkToNetworkInterconnects. It manages NetworkToNetworkInterconnect. + * + * @return Resource collection API of NetworkToNetworkInterconnects. + */ + public NetworkToNetworkInterconnects networkToNetworkInterconnects() { + if (this.networkToNetworkInterconnects == null) { + this.networkToNetworkInterconnects = + new NetworkToNetworkInterconnectsImpl(clientObject.getNetworkToNetworkInterconnects(), this); + } + return networkToNetworkInterconnects; + } + + /** + * Gets the resource collection API of NetworkRackSkus. + * + * @return Resource collection API of NetworkRackSkus. + */ + public NetworkRackSkus networkRackSkus() { + if (this.networkRackSkus == null) { + this.networkRackSkus = new NetworkRackSkusImpl(clientObject.getNetworkRackSkus(), this); + } + return networkRackSkus; + } + + /** + * Gets the resource collection API of NetworkRacks. It manages NetworkRack. + * + * @return Resource collection API of NetworkRacks. + */ + public NetworkRacks networkRacks() { + if (this.networkRacks == null) { + this.networkRacks = new NetworkRacksImpl(clientObject.getNetworkRacks(), this); + } + return networkRacks; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of RoutePolicies. It manages RoutePolicy. + * + * @return Resource collection API of RoutePolicies. + */ + public RoutePolicies routePolicies() { + if (this.routePolicies == null) { + this.routePolicies = new RoutePoliciesImpl(clientObject.getRoutePolicies(), this); + } + return routePolicies; + } + + /** + * @return Wrapped service client AzureNetworkFabricManagementServiceApi providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public AzureNetworkFabricManagementServiceApi serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AccessControlListsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AccessControlListsClient.java new file mode 100644 index 000000000000..9313b5f44ad0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AccessControlListsClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatch; + +/** An instance of this class provides access to all the operations defined in AccessControlListsClient. */ +public interface AccessControlListsClient { + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @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 AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String accessControlListName, AccessControlListInner body, Context context); + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessControlListInner create(String resourceGroupName, String accessControlListName, AccessControlListInner body); + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @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 AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context); + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessControlListInner getByResourceGroup(String resourceGroupName, String accessControlListName); + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @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 AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accessControlListName, AccessControlListPatch body, Context context); + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessControlListInner update(String resourceGroupName, String accessControlListName, AccessControlListPatch body); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accessControlListName, Context context); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accessControlListName); + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AzureNetworkFabricManagementServiceApi.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AzureNetworkFabricManagementServiceApi.java new file mode 100644 index 000000000000..3e2a412afa66 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AzureNetworkFabricManagementServiceApi.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureNetworkFabricManagementServiceApi class. */ +public interface AzureNetworkFabricManagementServiceApi { + /** + * 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 AccessControlListsClient object to access its operations. + * + * @return the AccessControlListsClient object. + */ + AccessControlListsClient getAccessControlLists(); + + /** + * Gets the IpCommunityListsClient object to access its operations. + * + * @return the IpCommunityListsClient object. + */ + IpCommunityListsClient getIpCommunityLists(); + + /** + * Gets the IpPrefixListsClient object to access its operations. + * + * @return the IpPrefixListsClient object. + */ + IpPrefixListsClient getIpPrefixLists(); + + /** + * Gets the L2IsolationDomainsClient object to access its operations. + * + * @return the L2IsolationDomainsClient object. + */ + L2IsolationDomainsClient getL2IsolationDomains(); + + /** + * Gets the L3IsolationDomainsClient object to access its operations. + * + * @return the L3IsolationDomainsClient object. + */ + L3IsolationDomainsClient getL3IsolationDomains(); + + /** + * Gets the InternalNetworksClient object to access its operations. + * + * @return the InternalNetworksClient object. + */ + InternalNetworksClient getInternalNetworks(); + + /** + * Gets the ExternalNetworksClient object to access its operations. + * + * @return the ExternalNetworksClient object. + */ + ExternalNetworksClient getExternalNetworks(); + + /** + * Gets the NetworkDeviceSkusClient object to access its operations. + * + * @return the NetworkDeviceSkusClient object. + */ + NetworkDeviceSkusClient getNetworkDeviceSkus(); + + /** + * Gets the NetworkDevicesClient object to access its operations. + * + * @return the NetworkDevicesClient object. + */ + NetworkDevicesClient getNetworkDevices(); + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + NetworkInterfacesClient getNetworkInterfaces(); + + /** + * Gets the NetworkFabricControllersClient object to access its operations. + * + * @return the NetworkFabricControllersClient object. + */ + NetworkFabricControllersClient getNetworkFabricControllers(); + + /** + * Gets the NetworkFabricSkusClient object to access its operations. + * + * @return the NetworkFabricSkusClient object. + */ + NetworkFabricSkusClient getNetworkFabricSkus(); + + /** + * Gets the NetworkFabricsClient object to access its operations. + * + * @return the NetworkFabricsClient object. + */ + NetworkFabricsClient getNetworkFabrics(); + + /** + * Gets the NetworkToNetworkInterconnectsClient object to access its operations. + * + * @return the NetworkToNetworkInterconnectsClient object. + */ + NetworkToNetworkInterconnectsClient getNetworkToNetworkInterconnects(); + + /** + * Gets the NetworkRackSkusClient object to access its operations. + * + * @return the NetworkRackSkusClient object. + */ + NetworkRackSkusClient getNetworkRackSkus(); + + /** + * Gets the NetworkRacksClient object to access its operations. + * + * @return the NetworkRacksClient object. + */ + NetworkRacksClient getNetworkRacks(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the RoutePoliciesClient object to access its operations. + * + * @return the RoutePoliciesClient object. + */ + RoutePoliciesClient getRoutePolicies(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/ExternalNetworksClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/ExternalNetworksClient.java new file mode 100644 index 000000000000..8996a36ef401 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/ExternalNetworksClient.java @@ -0,0 +1,745 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.ExternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** An instance of this class provides access to all the operations defined in ExternalNetworksClient. */ +public interface ExternalNetworksClient { + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalNetworkInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body); + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalNetworkInner> beginCreate( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context); + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalNetworkInner create( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body); + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalNetworkInner create( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context); + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @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 defines the ExternalNetwork item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, Context context); + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalNetworkInner get(String resourceGroupName, String l3IsolationDomainName, String externalNetworkName); + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalNetworkInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body); + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExternalNetworkInner> beginUpdate( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context); + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalNetworkInner update( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body); + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExternalNetworkInner update( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 l3IsolationDomainName, String externalNetworkName); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @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 l3IsolationDomainName, String externalNetworkName, Context context); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName, String externalNetworkName); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @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 l3IsolationDomainName, String externalNetworkName, Context context); + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ExternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String l3IsolationDomainName); + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @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 list of ExternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/InternalNetworksClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/InternalNetworksClient.java new file mode 100644 index 000000000000..ed3665e0f045 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/InternalNetworksClient.java @@ -0,0 +1,831 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.InternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** An instance of this class provides access to all the operations defined in InternalNetworksClient. */ +public interface InternalNetworksClient { + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InternalNetworkInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body); + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InternalNetworkInner> beginCreate( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context); + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InternalNetworkInner create( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body); + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InternalNetworkInner create( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context); + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @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 InternalNetworks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, Context context); + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 InternalNetworks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InternalNetworkInner get(String resourceGroupName, String l3IsolationDomainName, String internalNetworkName); + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InternalNetworkInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body); + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InternalNetworkInner> beginUpdate( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context); + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InternalNetworkInner update( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body); + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InternalNetworkInner update( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 l3IsolationDomainName, String internalNetworkName); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @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 l3IsolationDomainName, String internalNetworkName, Context context); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName, String internalNetworkName); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @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 l3IsolationDomainName, String internalNetworkName, Context context); + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 InternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String l3IsolationDomainName); + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @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 list of InternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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> beginUpdateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunityListsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunityListsClient.java new file mode 100644 index 000000000000..7675cac71e1b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunityListsClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatch; + +/** An instance of this class provides access to all the operations defined in IpCommunityListsClient. */ +public interface IpCommunityListsClient { + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @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 IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body, Context context); + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityListInner create(String resourceGroupName, String ipCommunityListName, IpCommunityListInner body); + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @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 IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context); + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityListInner getByResourceGroup(String resourceGroupName, String ipCommunityListName); + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @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 IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body, Context context); + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityListInner update(String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String ipCommunityListName, Context context); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipCommunityListName); + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixListsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixListsClient.java new file mode 100644 index 000000000000..59b621c49b6d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixListsClient.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixListPatch; + +/** An instance of this class provides access to all the operations defined in IpPrefixListsClient. */ +public interface IpPrefixListsClient { + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @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 IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String ipPrefixListName, IpPrefixListInner body, Context context); + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixListInner create(String resourceGroupName, String ipPrefixListName, IpPrefixListInner body); + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @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 IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context); + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixListInner getByResourceGroup(String resourceGroupName, String ipPrefixListName); + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @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 IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body, Context context); + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixListInner update(String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String ipPrefixListName, Context context); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipPrefixListName); + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L2IsolationDomainsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L2IsolationDomainsClient.java new file mode 100644 index 000000000000..f72b3a971b6b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L2IsolationDomainsClient.java @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.ArpPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Map; + +/** An instance of this class provides access to all the operations defined in L2IsolationDomainsClient. */ +public interface L2IsolationDomainsClient { + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2IsolationDomainInner> beginCreate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body); + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2IsolationDomainInner> beginCreate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context); + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2IsolationDomainInner create(String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body); + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @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 L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2IsolationDomainInner create( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context); + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @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 L2IsolationDomain resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String l2IsolationDomainName, Context context); + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2IsolationDomainInner getByResourceGroup(String resourceGroupName, String l2IsolationDomainName); + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2IsolationDomainInner> beginUpdate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body); + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2IsolationDomainInner> beginUpdate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context); + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2IsolationDomainInner update(String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body); + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2IsolationDomainInner update( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 l2IsolationDomainName); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @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 l2IsolationDomainName, Context context); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l2IsolationDomainName); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @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 l2IsolationDomainName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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> beginUpdateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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> beginClearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 clearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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> beginClearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, Map> beginGetArpEntries( + String resourceGroupName, String l2IsolationDomainName); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>, Map> beginGetArpEntries( + String resourceGroupName, String l2IsolationDomainName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map getArpEntries(String resourceGroupName, String l2IsolationDomainName); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map getArpEntries( + String resourceGroupName, String l2IsolationDomainName, Context context); + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L3IsolationDomainsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L3IsolationDomainsClient.java new file mode 100644 index 000000000000..72db75482a3d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L3IsolationDomainsClient.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** An instance of this class provides access to all the operations defined in L3IsolationDomainsClient. */ +public interface L3IsolationDomainsClient { + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3IsolationDomainInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body); + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3IsolationDomainInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context); + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3IsolationDomainInner create(String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body); + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @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 L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3IsolationDomainInner create( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context); + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @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 L3IsolationDomain resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3IsolationDomainInner getByResourceGroup(String resourceGroupName, String l3IsolationDomainName); + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3IsolationDomainInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body); + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3IsolationDomainInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context); + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3IsolationDomainInner update(String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body); + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3IsolationDomainInner update( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 l3IsolationDomainName); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @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 l3IsolationDomainName, Context context); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @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 l3IsolationDomainName, Context context); + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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> beginUpdateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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> beginUpdateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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> beginClearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 clearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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> beginClearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDeviceSkusClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDeviceSkusClient.java new file mode 100644 index 000000000000..8aebea12bb2a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDeviceSkusClient.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.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; + +/** An instance of this class provides access to all the operations defined in NetworkDeviceSkusClient. */ +public interface NetworkDeviceSkusClient { + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @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 Device SKU details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String networkDeviceSkuName, Context context); + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Device SKU details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceSkuInner get(String networkDeviceSkuName); + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDevicesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDevicesClient.java new file mode 100644 index 000000000000..ad4938c5ac87 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDevicesClient.java @@ -0,0 +1,834 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicePatchParameters; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in NetworkDevicesClient. */ +public interface NetworkDevicesClient { + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkDeviceInner> beginCreate( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body); + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkDeviceInner> beginCreate( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context); + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceInner create(String resourceGroupName, String networkDeviceName, NetworkDeviceInner body); + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @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 NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceInner create( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context); + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @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 Network Device resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceInner getByResourceGroup(String resourceGroupName, String networkDeviceName); + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkDeviceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body); + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkDeviceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context); + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceInner update(String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body); + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @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 NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkDeviceInner update( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkDeviceName); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @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 networkDeviceName, Context context); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkDeviceName); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @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 networkDeviceName, Context context); + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginReboot(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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> beginReboot(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reboot(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 reboot(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRestoreConfig(String resourceGroupName, String networkDeviceName); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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> beginRestoreConfig( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restoreConfig(String resourceGroupName, String networkDeviceName); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 restoreConfig(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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> beginUpdateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateVersion(String resourceGroupName, String networkDeviceName, UpdateVersionProperties body); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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 updateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SupportPackagePropertiesInner> beginGenerateSupportPackage( + String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SupportPackagePropertiesInner> beginGenerateSupportPackage( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportPackagePropertiesInner generateSupportPackage(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportPackagePropertiesInner generateSupportPackage( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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> beginUpdatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updatePowerCycle(String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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 updatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GetDeviceStatusPropertiesInner> beginGetStatus( + String resourceGroupName, String networkDeviceName); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GetDeviceStatusPropertiesInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetDeviceStatusPropertiesInner getStatus(String resourceGroupName, String networkDeviceName); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetDeviceStatusPropertiesInner getStatus(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult>, + List> + beginGetStaticInterfaceMaps(String resourceGroupName, String networkDeviceName); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult>, + List> + beginGetStaticInterfaceMaps(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult>, + List> + beginGetDynamicInterfaceMaps(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult>, + List> + beginGetDynamicInterfaceMaps(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricControllersClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricControllersClient.java new file mode 100644 index 000000000000..0e34ae7b847c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricControllersClient.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPatch; + +/** An instance of this class provides access to all the operations defined in NetworkFabricControllersClient. */ +public interface NetworkFabricControllersClient { + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricControllerInner> beginCreate( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body); + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricControllerInner> beginCreate( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context); + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricControllerInner create( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body); + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @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 NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricControllerInner create( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context); + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @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 NetworkFabricController resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricControllerInner getByResourceGroup(String resourceGroupName, String networkFabricControllerName); + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricControllerInner> beginUpdate( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body); + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricControllerInner> beginUpdate( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context); + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricControllerInner update( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body); + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @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 NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricControllerInner update( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkFabricControllerName); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @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 networkFabricControllerName, Context context); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricControllerName); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @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 networkFabricControllerName, Context context); + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginEnableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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> beginEnableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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 enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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> beginDisableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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 disableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricSkusClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricSkusClient.java new file mode 100644 index 000000000000..a31a13b26936 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricSkusClient.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.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; + +/** An instance of this class provides access to all the operations defined in NetworkFabricSkusClient. */ +public interface NetworkFabricSkusClient { + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @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 NetworkFabricSku resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String networkFabricSkuName, Context context); + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricSkuInner get(String networkFabricSkuName); + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 NetworkFabricSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @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 list of NetworkFabricSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java new file mode 100644 index 000000000000..9808d85563de --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.NetworkFabricInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPatchParameters; + +/** An instance of this class provides access to all the operations defined in NetworkFabricsClient. */ +public interface NetworkFabricsClient { + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricInner> beginCreate( + String resourceGroupName, String networkFabricName, NetworkFabricInner body); + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricInner> beginCreate( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context); + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricInner create(String resourceGroupName, String networkFabricName, NetworkFabricInner body); + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @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 NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricInner create( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context); + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @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 Fabric resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricName, Context context); + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Fabric resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricInner getByResourceGroup(String resourceGroupName, String networkFabricName); + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricInner> beginUpdate( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body); + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFabricInner> beginUpdate( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context); + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricInner update(String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body); + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @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 NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFabricInner update( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkFabricName); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @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 networkFabricName, Context context); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricName); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @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 networkFabricName, Context context); + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginProvision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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> beginProvision( + String resourceGroupName, String networkFabricName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 provision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 provision(String resourceGroupName, String networkFabricName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDeprovision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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> beginDeprovision( + String resourceGroupName, String networkFabricName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deprovision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 deprovision(String resourceGroupName, String networkFabricName, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkInterfacesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkInterfacesClient.java new file mode 100644 index 000000000000..c4d534f812cb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkInterfacesClient.java @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.InterfaceStatusInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacePatch; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ +public interface NetworkInterfacesClient { + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfaceInner> beginCreate( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body); + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfaceInner> beginCreate( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context); + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner create( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body); + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner create( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context); + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @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 Network Interface resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context); + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner get(String resourceGroupName, String networkDeviceName, String networkInterfaceName); + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfaceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body); + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkInterfaceInner> beginUpdate( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context); + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner update( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body); + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner update( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkDeviceName, String networkInterfaceName); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @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 networkDeviceName, String networkInterfaceName, Context context); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkDeviceName, String networkInterfaceName); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @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 networkDeviceName, String networkInterfaceName, Context context); + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkDeviceName); + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 list of NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InterfaceStatusInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, InterfaceStatusInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InterfaceStatusInner getStatus(String resourceGroupName, String networkDeviceName, String networkInterfaceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @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 running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InterfaceStatusInner getStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @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> beginUpdateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRackSkusClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRackSkusClient.java new file mode 100644 index 000000000000..39fdae0cb744 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRackSkusClient.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.managednetworkfabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; + +/** An instance of this class provides access to all the operations defined in NetworkRackSkusClient. */ +public interface NetworkRackSkusClient { + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @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 Rack SKU resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String networkRackSkuName, Context context); + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rack SKU resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackSkuInner get(String networkRackSkuName); + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRacksClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRacksClient.java new file mode 100644 index 000000000000..1e377ea3235e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRacksClient.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.managednetworkfabric.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.managednetworkfabric.fluent.models.NetworkRackInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackPatch; + +/** An instance of this class provides access to all the operations defined in NetworkRacksClient. */ +public interface NetworkRacksClient { + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkRackInner> beginCreate( + String resourceGroupName, String networkRackName, NetworkRackInner body); + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkRackInner> beginCreate( + String resourceGroupName, String networkRackName, NetworkRackInner body, Context context); + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackInner create(String resourceGroupName, String networkRackName, NetworkRackInner body); + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @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 NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackInner create(String resourceGroupName, String networkRackName, NetworkRackInner body, Context context); + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @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 Rack resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkRackName, Context context); + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rack resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackInner getByResourceGroup(String resourceGroupName, String networkRackName); + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkRackInner> beginUpdate( + String resourceGroupName, String networkRackName, NetworkRackPatch body); + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkRackInner> beginUpdate( + String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context); + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackInner update(String resourceGroupName, String networkRackName, NetworkRackPatch body); + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @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 NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkRackInner update(String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkRackName); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @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 networkRackName, Context context); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkRackName); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @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 networkRackName, Context context); + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkToNetworkInterconnectsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkToNetworkInterconnectsClient.java new file mode 100644 index 000000000000..88be04bfaa5e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkToNetworkInterconnectsClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; + +/** An instance of this class provides access to all the operations defined in NetworkToNetworkInterconnectsClient. */ +public interface NetworkToNetworkInterconnectsClient { + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkToNetworkInterconnectInner> beginCreate( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkToNetworkInterconnectInner> beginCreate( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkToNetworkInterconnectInner create( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @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 NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkToNetworkInterconnectInner create( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @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 NetworkToNetworkInterconnect resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, Context context); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkToNetworkInterconnectInner get( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 networkFabricName, String networkToNetworkInterconnectName); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @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 networkFabricName, String networkToNetworkInterconnectName, Context context); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricName, String networkToNetworkInterconnectName); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @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 networkFabricName, String networkToNetworkInterconnectName, Context context); + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkFabricName); + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 list of NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkFabricName, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/OperationsClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/OperationsClient.java new file mode 100644 index 000000000000..883c288bb605 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/OperationsClient.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.managednetworkfabric.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.managednetworkfabric.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/RoutePoliciesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/RoutePoliciesClient.java new file mode 100644 index 000000000000..9269cca65637 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/RoutePoliciesClient.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.managednetworkfabric.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.managednetworkfabric.fluent.models.RoutePolicyInner; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPatch; + +/** An instance of this class provides access to all the operations defined in RoutePoliciesClient. */ +public interface RoutePoliciesClient { + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutePolicyInner> beginCreate( + String resourceGroupName, String routePolicyName, RoutePolicyInner body); + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutePolicyInner> beginCreate( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context); + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutePolicyInner create(String resourceGroupName, String routePolicyName, RoutePolicyInner body); + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @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 RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutePolicyInner create(String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context); + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String routePolicyName, Context context); + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutePolicyInner getByResourceGroup(String resourceGroupName, String routePolicyName); + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutePolicyInner> beginUpdate( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body); + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutePolicyInner> beginUpdate( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context); + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutePolicyInner update(String resourceGroupName, String routePolicyName, RoutePolicyPatch body); + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @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 RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutePolicyInner update(String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context); + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java new file mode 100644 index 000000000000..cbdbad4a7b87 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.models.AccessControlListPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The AccessControlList resource definition. */ +@Fluent +public final class AccessControlListInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private AccessControlListProperties innerProperties = new AccessControlListProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of AccessControlListInner class. */ + public AccessControlListInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private AccessControlListProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @return the addressFamily value. + */ + public AddressFamily addressFamily() { + return this.innerProperties() == null ? null : this.innerProperties().addressFamily(); + } + + /** + * Set the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @param addressFamily the addressFamily value to set. + * @return the AccessControlListInner object itself. + */ + public AccessControlListInner withAddressFamily(AddressFamily addressFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListProperties(); + } + this.innerProperties().withAddressFamily(addressFamily); + return this; + } + + /** + * Get the conditions property: Access Control List conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: Access Control List conditions. + * + * @param conditions the conditions value to set. + * @return the AccessControlListInner object itself. + */ + public AccessControlListInner withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListProperties(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the AccessControlListInner object itself. + */ + public AccessControlListInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 AccessControlListInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java new file mode 100644 index 000000000000..d855cf3de899 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AccessControlListPatchProperties define the patchable resource properties. */ +@Fluent +public final class AccessControlListPatchProperties extends AnnotationResource { + /* + * IP address family. Example: ipv4 | ipv6. + */ + @JsonProperty(value = "addressFamily") + private AddressFamily addressFamily; + + /* + * Access Control List conditions. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /** Creates an instance of AccessControlListPatchProperties class. */ + public AccessControlListPatchProperties() { + } + + /** + * Get the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @return the addressFamily value. + */ + public AddressFamily addressFamily() { + return this.addressFamily; + } + + /** + * Set the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @param addressFamily the addressFamily value to set. + * @return the AccessControlListPatchProperties object itself. + */ + public AccessControlListPatchProperties withAddressFamily(AddressFamily addressFamily) { + this.addressFamily = addressFamily; + return this; + } + + /** + * Get the conditions property: Access Control List conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Access Control List conditions. + * + * @param conditions the conditions value to set. + * @return the AccessControlListPatchProperties object itself. + */ + public AccessControlListPatchProperties withConditions( + List conditions) { + this.conditions = conditions; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java new file mode 100644 index 000000000000..24cf9ae130a0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AccessControlListProperties define the resource properties. */ +@Fluent +public final class AccessControlListProperties extends AnnotationResource { + /* + * IP address family. Example: ipv4 | ipv6. + */ + @JsonProperty(value = "addressFamily", required = true) + private AddressFamily addressFamily; + + /* + * Access Control List conditions. + */ + @JsonProperty(value = "conditions", required = true) + private List conditions; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of AccessControlListProperties class. */ + public AccessControlListProperties() { + } + + /** + * Get the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @return the addressFamily value. + */ + public AddressFamily addressFamily() { + return this.addressFamily; + } + + /** + * Set the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @param addressFamily the addressFamily value to set. + * @return the AccessControlListProperties object itself. + */ + public AccessControlListProperties withAddressFamily(AddressFamily addressFamily) { + this.addressFamily = addressFamily; + return this; + } + + /** + * Get the conditions property: Access Control List conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Access Control List conditions. + * + * @param conditions the conditions value to set. + * @return the AccessControlListProperties object itself. + */ + public AccessControlListProperties withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (addressFamily() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property addressFamily in model AccessControlListProperties")); + } + if (conditions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property conditions in model AccessControlListProperties")); + } else { + conditions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ArpPropertiesInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ArpPropertiesInner.java new file mode 100644 index 000000000000..e98ddf8c94e0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ArpPropertiesInner.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Show ARP table entry properties. */ +@Fluent +public final class ArpPropertiesInner { + /* + * Ipv4 or Ipv6 address + */ + @JsonProperty(value = "address", required = true) + private String address; + + /* + * Duration in seconds. + */ + @JsonProperty(value = "age", required = true) + private String age; + + /* + * Hardware address. + */ + @JsonProperty(value = "macAddress", required = true) + private String macAddress; + + /* + * Layer 2 interface name. + */ + @JsonProperty(value = "interface", required = true) + private String interfaceProperty; + + /* + * ARP status + */ + @JsonProperty(value = "state") + private String state; + + /** Creates an instance of ArpPropertiesInner class. */ + public ArpPropertiesInner() { + } + + /** + * Get the address property: Ipv4 or Ipv6 address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Ipv4 or Ipv6 address. + * + * @param address the address value to set. + * @return the ArpPropertiesInner object itself. + */ + public ArpPropertiesInner withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the age property: Duration in seconds. + * + * @return the age value. + */ + public String age() { + return this.age; + } + + /** + * Set the age property: Duration in seconds. + * + * @param age the age value to set. + * @return the ArpPropertiesInner object itself. + */ + public ArpPropertiesInner withAge(String age) { + this.age = age; + return this; + } + + /** + * Get the macAddress property: Hardware address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: Hardware address. + * + * @param macAddress the macAddress value to set. + * @return the ArpPropertiesInner object itself. + */ + public ArpPropertiesInner withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the interfaceProperty property: Layer 2 interface name. + * + * @return the interfaceProperty value. + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set the interfaceProperty property: Layer 2 interface name. + * + * @param interfaceProperty the interfaceProperty value to set. + * @return the ArpPropertiesInner object itself. + */ + public ArpPropertiesInner withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the state property: ARP status. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: ARP status. + * + * @param state the state value to set. + * @return the ArpPropertiesInner object itself. + */ + public ArpPropertiesInner withState(String state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (address() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property address in model ArpPropertiesInner")); + } + if (age() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property age in model ArpPropertiesInner")); + } + if (macAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property macAddress in model ArpPropertiesInner")); + } + if (interfaceProperty() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property interfaceProperty in model ArpPropertiesInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ArpPropertiesInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java new file mode 100644 index 000000000000..ec4aa5c18692 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the ExternalNetwork item. */ +@Fluent +public final class ExternalNetworkInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private ExternalNetworkProperties innerProperties = new ExternalNetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExternalNetworkInner class. */ + public ExternalNetworkInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private ExternalNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. + * + * @return the networkToNetworkInterconnectId value. + */ + public String networkToNetworkInterconnectId() { + return this.innerProperties() == null ? null : this.innerProperties().networkToNetworkInterconnectId(); + } + + /** + * Get the disabledOnResources property: List of resources the externalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().disabledOnResources(); + } + + /** + * Get the administrativeState property: AdministrativeState of the externalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.innerProperties() == null ? null : this.innerProperties().peeringOption(); + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withPeeringOption(PeeringOption peeringOption) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withPeeringOption(peeringOption); + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBProperties optionBProperties() { + return this.innerProperties() == null ? null : this.innerProperties().optionBProperties(); + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withOptionBProperties(OptionBProperties optionBProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withOptionBProperties(optionBProperties); + return this; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public ExternalNetworkPropertiesOptionAProperties optionAProperties() { + return this.innerProperties() == null ? null : this.innerProperties().optionAProperties(); + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withOptionAProperties(ExternalNetworkPropertiesOptionAProperties optionAProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withOptionAProperties(optionAProperties); + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().importRoutePolicyId(); + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withImportRoutePolicyId(String importRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withImportRoutePolicyId(importRoutePolicyId); + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().exportRoutePolicyId(); + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withExportRoutePolicyId(String exportRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the ExternalNetworkInner object itself. + */ + public ExternalNetworkInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 ExternalNetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExternalNetworkInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkPatchProperties.java new file mode 100644 index 000000000000..53163d6235c1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkPatchProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** External Network Patch properties. */ +@Fluent +public final class ExternalNetworkPatchProperties extends AnnotationResource { + /* + * Peering option list. + */ + @JsonProperty(value = "peeringOption") + private PeeringOption peeringOption; + + /* + * option B properties object + */ + @JsonProperty(value = "optionBProperties") + private OptionBProperties optionBProperties; + + /* + * option A properties object + */ + @JsonProperty(value = "optionAProperties") + private OptionAProperties optionAProperties; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of exportRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of ExternalNetworkPatchProperties class. */ + public ExternalNetworkPatchProperties() { + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.peeringOption; + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the ExternalNetworkPatchProperties object itself. + */ + public ExternalNetworkPatchProperties withPeeringOption(PeeringOption peeringOption) { + this.peeringOption = peeringOption; + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBProperties optionBProperties() { + return this.optionBProperties; + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the ExternalNetworkPatchProperties object itself. + */ + public ExternalNetworkPatchProperties withOptionBProperties(OptionBProperties optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public OptionAProperties optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the ExternalNetworkPatchProperties object itself. + */ + public ExternalNetworkPatchProperties withOptionAProperties(OptionAProperties optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the ExternalNetworkPatchProperties object itself. + */ + public ExternalNetworkPatchProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the ExternalNetworkPatchProperties object itself. + */ + public ExternalNetworkPatchProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (optionBProperties() != null) { + optionBProperties().validate(); + } + if (optionAProperties() != null) { + optionAProperties().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkProperties.java new file mode 100644 index 000000000000..2b865fb2fa31 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkProperties.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** External Network Properties. */ +@Fluent +public final class ExternalNetworkProperties extends AnnotationResource { + /* + * Gets the networkToNetworkInterconnectId of the resource. + */ + @JsonProperty(value = "networkToNetworkInterconnectId", access = JsonProperty.Access.WRITE_ONLY) + private String networkToNetworkInterconnectId; + + /* + * List of resources the externalNetwork is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "disabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List disabledOnResources; + + /* + * AdministrativeState of the externalNetwork. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Peering option list. + */ + @JsonProperty(value = "peeringOption", required = true) + private PeeringOption peeringOption; + + /* + * option B properties object + */ + @JsonProperty(value = "optionBProperties") + private OptionBProperties optionBProperties; + + /* + * option A properties object + */ + @JsonProperty(value = "optionAProperties") + private ExternalNetworkPropertiesOptionAProperties optionAProperties; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of exportRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of ExternalNetworkProperties class. */ + public ExternalNetworkProperties() { + } + + /** + * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. + * + * @return the networkToNetworkInterconnectId value. + */ + public String networkToNetworkInterconnectId() { + return this.networkToNetworkInterconnectId; + } + + /** + * Get the disabledOnResources property: List of resources the externalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.disabledOnResources; + } + + /** + * Get the administrativeState property: AdministrativeState of the externalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.peeringOption; + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the ExternalNetworkProperties object itself. + */ + public ExternalNetworkProperties withPeeringOption(PeeringOption peeringOption) { + this.peeringOption = peeringOption; + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBProperties optionBProperties() { + return this.optionBProperties; + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the ExternalNetworkProperties object itself. + */ + public ExternalNetworkProperties withOptionBProperties(OptionBProperties optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public ExternalNetworkPropertiesOptionAProperties optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the ExternalNetworkProperties object itself. + */ + public ExternalNetworkProperties withOptionAProperties( + ExternalNetworkPropertiesOptionAProperties optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the ExternalNetworkProperties object itself. + */ + public ExternalNetworkProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the ExternalNetworkProperties object itself. + */ + public ExternalNetworkProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (peeringOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property peeringOption in model ExternalNetworkProperties")); + } + if (optionBProperties() != null) { + optionBProperties().validate(); + } + if (optionAProperties() != null) { + optionAProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExternalNetworkProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDeviceStatusPropertiesInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDeviceStatusPropertiesInner.java new file mode 100644 index 000000000000..f6d01e598384 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDeviceStatusPropertiesInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.OperationalStatus; +import com.azure.resourcemanager.managednetworkfabric.models.PowerCycleState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Device status response properties. */ +@Fluent +public final class GetDeviceStatusPropertiesInner { + /* + * Primary or Secondary power end. + */ + @JsonProperty(value = "operationalStatus", required = true) + private OperationalStatus operationalStatus; + + /* + * On or Off power cycle state. + */ + @JsonProperty(value = "powerCycleState", required = true) + private PowerCycleState powerCycleState; + + /* + * The serial number of the device + */ + @JsonProperty(value = "serialNumber", required = true) + private String serialNumber; + + /** Creates an instance of GetDeviceStatusPropertiesInner class. */ + public GetDeviceStatusPropertiesInner() { + } + + /** + * Get the operationalStatus property: Primary or Secondary power end. + * + * @return the operationalStatus value. + */ + public OperationalStatus operationalStatus() { + return this.operationalStatus; + } + + /** + * Set the operationalStatus property: Primary or Secondary power end. + * + * @param operationalStatus the operationalStatus value to set. + * @return the GetDeviceStatusPropertiesInner object itself. + */ + public GetDeviceStatusPropertiesInner withOperationalStatus(OperationalStatus operationalStatus) { + this.operationalStatus = operationalStatus; + return this; + } + + /** + * Get the powerCycleState property: On or Off power cycle state. + * + * @return the powerCycleState value. + */ + public PowerCycleState powerCycleState() { + return this.powerCycleState; + } + + /** + * Set the powerCycleState property: On or Off power cycle state. + * + * @param powerCycleState the powerCycleState value to set. + * @return the GetDeviceStatusPropertiesInner object itself. + */ + public GetDeviceStatusPropertiesInner withPowerCycleState(PowerCycleState powerCycleState) { + this.powerCycleState = powerCycleState; + return this; + } + + /** + * Get the serialNumber property: The serial number of the device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number of the device. + * + * @param serialNumber the serialNumber value to set. + * @return the GetDeviceStatusPropertiesInner object itself. + */ + public GetDeviceStatusPropertiesInner withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operationalStatus() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operationalStatus in model GetDeviceStatusPropertiesInner")); + } + if (powerCycleState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property powerCycleState in model GetDeviceStatusPropertiesInner")); + } + if (serialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serialNumber in model GetDeviceStatusPropertiesInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetDeviceStatusPropertiesInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDynamicInterfaceMapsPropertiesItemInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDynamicInterfaceMapsPropertiesItemInner.java new file mode 100644 index 000000000000..4a0356ea20c7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDynamicInterfaceMapsPropertiesItemInner.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Device static interface maps as per topology. */ +@Fluent +public final class GetDynamicInterfaceMapsPropertiesItemInner extends InterfaceStatusInner { + /* + * The interface name. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of GetDynamicInterfaceMapsPropertiesItemInner class. */ + public GetDynamicInterfaceMapsPropertiesItemInner() { + } + + /** + * Get the name property: The interface name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The interface name. + * + * @param name the name value to set. + * @return the GetDynamicInterfaceMapsPropertiesItemInner object itself. + */ + public GetDynamicInterfaceMapsPropertiesItemInner withName(String name) { + this.name = name; + return this; + } + + /** {@inheritDoc} */ + @Override + public GetDynamicInterfaceMapsPropertiesItemInner withOperationalStatus(String operationalStatus) { + super.withOperationalStatus(operationalStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public GetDynamicInterfaceMapsPropertiesItemInner withPhyStatus(String phyStatus) { + super.withPhyStatus(phyStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public GetDynamicInterfaceMapsPropertiesItemInner withTransceiverStatus(String transceiverStatus) { + super.withTransceiverStatus(transceiverStatus); + return this; + } + + /** {@inheritDoc} */ + @Override + public GetDynamicInterfaceMapsPropertiesItemInner withConnectedTo(String connectedTo) { + super.withConnectedTo(connectedTo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetStaticInterfaceMapsPropertiesItemInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetStaticInterfaceMapsPropertiesItemInner.java new file mode 100644 index 000000000000..c744fd2a0b61 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetStaticInterfaceMapsPropertiesItemInner.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Device static interface maps as per topology. */ +@Fluent +public final class GetStaticInterfaceMapsPropertiesItemInner { + /* + * The interface name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The interface description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The interface identifier. + */ + @JsonProperty(value = "identifier") + private String identifier; + + /* + * The interface type. Example: Ethernet + */ + @JsonProperty(value = "interfaceType") + private String interfaceType; + + /* + * The physical cable connector type. Example: Optical + */ + @JsonProperty(value = "connectorType") + private String connectorType; + + /* + * Connected to ARM resource or external interface + */ + @JsonProperty(value = "connectedTo") + private String connectedTo; + + /* + * The interface speed. Example: 100 + */ + @JsonProperty(value = "speed") + private Float speed; + + /* + * The port channel group id. + */ + @JsonProperty(value = "channelGroupId") + private Float channelGroupId; + + /** Creates an instance of GetStaticInterfaceMapsPropertiesItemInner class. */ + public GetStaticInterfaceMapsPropertiesItemInner() { + } + + /** + * Get the name property: The interface name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The interface name. + * + * @param name the name value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: The interface description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The interface description. + * + * @param description the description value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the identifier property: The interface identifier. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: The interface identifier. + * + * @param identifier the identifier value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the interfaceType property: The interface type. Example: Ethernet. + * + * @return the interfaceType value. + */ + public String interfaceType() { + return this.interfaceType; + } + + /** + * Set the interfaceType property: The interface type. Example: Ethernet. + * + * @param interfaceType the interfaceType value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withInterfaceType(String interfaceType) { + this.interfaceType = interfaceType; + return this; + } + + /** + * Get the connectorType property: The physical cable connector type. Example: Optical. + * + * @return the connectorType value. + */ + public String connectorType() { + return this.connectorType; + } + + /** + * Set the connectorType property: The physical cable connector type. Example: Optical. + * + * @param connectorType the connectorType value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withConnectorType(String connectorType) { + this.connectorType = connectorType; + return this; + } + + /** + * Get the connectedTo property: Connected to ARM resource or external interface. + * + * @return the connectedTo value. + */ + public String connectedTo() { + return this.connectedTo; + } + + /** + * Set the connectedTo property: Connected to ARM resource or external interface. + * + * @param connectedTo the connectedTo value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withConnectedTo(String connectedTo) { + this.connectedTo = connectedTo; + return this; + } + + /** + * Get the speed property: The interface speed. Example: 100. + * + * @return the speed value. + */ + public Float speed() { + return this.speed; + } + + /** + * Set the speed property: The interface speed. Example: 100. + * + * @param speed the speed value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withSpeed(Float speed) { + this.speed = speed; + return this; + } + + /** + * Get the channelGroupId property: The port channel group id. + * + * @return the channelGroupId value. + */ + public Float channelGroupId() { + return this.channelGroupId; + } + + /** + * Set the channelGroupId property: The port channel group id. + * + * @param channelGroupId the channelGroupId value to set. + * @return the GetStaticInterfaceMapsPropertiesItemInner object itself. + */ + public GetStaticInterfaceMapsPropertiesItemInner withChannelGroupId(Float channelGroupId) { + this.channelGroupId = channelGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InterfaceStatusInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InterfaceStatusInner.java new file mode 100644 index 000000000000..ed336589dd7f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InterfaceStatusInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Interface running status properties. */ +@Fluent +public class InterfaceStatusInner { + /* + * The interface administrative state. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * The interface operational status. + */ + @JsonProperty(value = "operationalStatus") + private String operationalStatus; + + /* + * The physical status. + */ + @JsonProperty(value = "phyStatus") + private String phyStatus; + + /* + * The interface transceiver type. Example: up or down + */ + @JsonProperty(value = "transceiverStatus") + private String transceiverStatus; + + /* + * Connected to ARM resource or external interface + */ + @JsonProperty(value = "connectedTo") + private String connectedTo; + + /** Creates an instance of InterfaceStatusInner class. */ + public InterfaceStatusInner() { + } + + /** + * Get the administrativeState property: The interface administrative state. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the operationalStatus property: The interface operational status. + * + * @return the operationalStatus value. + */ + public String operationalStatus() { + return this.operationalStatus; + } + + /** + * Set the operationalStatus property: The interface operational status. + * + * @param operationalStatus the operationalStatus value to set. + * @return the InterfaceStatusInner object itself. + */ + public InterfaceStatusInner withOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + return this; + } + + /** + * Get the phyStatus property: The physical status. + * + * @return the phyStatus value. + */ + public String phyStatus() { + return this.phyStatus; + } + + /** + * Set the phyStatus property: The physical status. + * + * @param phyStatus the phyStatus value to set. + * @return the InterfaceStatusInner object itself. + */ + public InterfaceStatusInner withPhyStatus(String phyStatus) { + this.phyStatus = phyStatus; + return this; + } + + /** + * Get the transceiverStatus property: The interface transceiver type. Example: up or down. + * + * @return the transceiverStatus value. + */ + public String transceiverStatus() { + return this.transceiverStatus; + } + + /** + * Set the transceiverStatus property: The interface transceiver type. Example: up or down. + * + * @param transceiverStatus the transceiverStatus value to set. + * @return the InterfaceStatusInner object itself. + */ + public InterfaceStatusInner withTransceiverStatus(String transceiverStatus) { + this.transceiverStatus = transceiverStatus; + return this; + } + + /** + * Get the connectedTo property: Connected to ARM resource or external interface. + * + * @return the connectedTo value. + */ + public String connectedTo() { + return this.connectedTo; + } + + /** + * Set the connectedTo property: Connected to ARM resource or external interface. + * + * @param connectedTo the connectedTo value to set. + * @return the InterfaceStatusInner object itself. + */ + public InterfaceStatusInner withConnectedTo(String connectedTo) { + this.connectedTo = connectedTo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkInner.java new file mode 100644 index 000000000000..9c0963c430f4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkInner.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the InternalNetwork item. */ +@Fluent +public final class InternalNetworkInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private InternalNetworkProperties innerProperties = new InternalNetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of InternalNetworkInner class. */ + public InternalNetworkInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private InternalNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the disabledOnResources property: List of resources the InternalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().disabledOnResources(); + } + + /** + * Get the administrativeState property: Administrative state of the InternalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the bgpDisabledOnResources property: List of resources the BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bgpDisabledOnResources value. + */ + public List bgpDisabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().bgpDisabledOnResources(); + } + + /** + * Get the bfdDisabledOnResources property: List of resources the BFD for BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bfdDisabledOnResources value. + */ + public List bfdDisabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().bfdDisabledOnResources(); + } + + /** + * Get the bfdForStaticRoutesDisabledOnResources property: List of resources the BFD of StaticRoutes is disabled on. + * Can be either entire NetworkFabric or NetworkRack. + * + * @return the bfdForStaticRoutesDisabledOnResources value. + */ + public List bfdForStaticRoutesDisabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().bfdForStaticRoutesDisabledOnResources(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vlanId property: Vlan identifier. Example: 1001. + * + * @return the vlanId value. + */ + public int vlanId() { + return this.innerProperties() == null ? 0 : this.innerProperties().vlanId(); + } + + /** + * Set the vlanId property: Vlan identifier. Example: 1001. + * + * @param vlanId the vlanId value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withVlanId(int vlanId) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withVlanId(vlanId); + return this; + } + + /** + * Get the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.innerProperties() == null ? null : this.innerProperties().mtu(); + } + + /** + * Set the mtu property: Maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withMtu(Integer mtu) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withMtu(mtu); + return this; + } + + /** + * Get the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv4Subnets(); + } + + /** + * Set the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @param connectedIPv4Subnets the connectedIPv4Subnets value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withConnectedIPv4Subnets(connectedIPv4Subnets); + return this; + } + + /** + * Get the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv6Subnets(); + } + + /** + * Set the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @param connectedIPv6Subnets the connectedIPv6Subnets value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withConnectedIPv6Subnets(connectedIPv6Subnets); + return this; + } + + /** + * Get the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().staticRouteConfiguration(); + } + + /** + * Set the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().bgpConfiguration(); + } + + /** + * Set the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration the bgpConfiguration value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withBgpConfiguration(bgpConfiguration); + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().importRoutePolicyId(); + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withImportRoutePolicyId(String importRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withImportRoutePolicyId(importRoutePolicyId); + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().exportRoutePolicyId(); + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withExportRoutePolicyId(String exportRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 InternalNetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InternalNetworkInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkPatchProperties.java new file mode 100644 index 000000000000..952d2071c947 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkPatchProperties.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** InternalNetwork Patch properties. */ +@Fluent +public final class InternalNetworkPatchProperties extends AnnotationResource { + /* + * Maximum transmission unit. Default value is 1500. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * List with object connectedIPv4Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connectedIPv6Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * staticRouteConfiguration model. + */ + @JsonProperty(value = "staticRouteConfiguration") + private InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of InternalNetworkPatchProperties class. */ + public InternalNetworkPatchProperties() { + } + + /** + * Get the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: Maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @param connectedIPv4Subnets the connectedIPv4Subnets value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + this.connectedIPv4Subnets = connectedIPv4Subnets; + return this; + } + + /** + * Get the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @param connectedIPv6Subnets the connectedIPv6Subnets value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + this.connectedIPv6Subnets = connectedIPv6Subnets; + return this; + } + + /** + * Get the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.bgpConfiguration; + } + + /** + * Set the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration the bgpConfiguration value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + this.bgpConfiguration = bgpConfiguration; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** {@inheritDoc} */ + @Override + public InternalNetworkPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (connectedIPv4Subnets() != null) { + connectedIPv4Subnets().forEach(e -> e.validate()); + } + if (connectedIPv6Subnets() != null) { + connectedIPv6Subnets().forEach(e -> e.validate()); + } + if (staticRouteConfiguration() != null) { + staticRouteConfiguration().validate(); + } + if (bgpConfiguration() != null) { + bgpConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkProperties.java new file mode 100644 index 000000000000..ce6775583fb9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkProperties.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Internal Network Properties. */ +@Fluent +public final class InternalNetworkProperties extends AnnotationResource { + /* + * List of resources the InternalNetwork is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "disabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List disabledOnResources; + + /* + * Administrative state of the InternalNetwork. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * List of resources the BGP is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "bgpDisabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List bgpDisabledOnResources; + + /* + * List of resources the BFD for BGP is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "bfdDisabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List bfdDisabledOnResources; + + /* + * List of resources the BFD of StaticRoutes is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "bfdForStaticRoutesDisabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List bfdForStaticRoutesDisabledOnResources; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Vlan identifier. Example: 1001. + */ + @JsonProperty(value = "vlanId", required = true) + private int vlanId; + + /* + * Maximum transmission unit. Default value is 1500. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * List with object connectedIPv4Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connectedIPv6Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * staticRouteConfiguration model. + */ + @JsonProperty(value = "staticRouteConfiguration") + private InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of InternalNetworkProperties class. */ + public InternalNetworkProperties() { + } + + /** + * Get the disabledOnResources property: List of resources the InternalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.disabledOnResources; + } + + /** + * Get the administrativeState property: Administrative state of the InternalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the bgpDisabledOnResources property: List of resources the BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bgpDisabledOnResources value. + */ + public List bgpDisabledOnResources() { + return this.bgpDisabledOnResources; + } + + /** + * Get the bfdDisabledOnResources property: List of resources the BFD for BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bfdDisabledOnResources value. + */ + public List bfdDisabledOnResources() { + return this.bfdDisabledOnResources; + } + + /** + * Get the bfdForStaticRoutesDisabledOnResources property: List of resources the BFD of StaticRoutes is disabled on. + * Can be either entire NetworkFabric or NetworkRack. + * + * @return the bfdForStaticRoutesDisabledOnResources value. + */ + public List bfdForStaticRoutesDisabledOnResources() { + return this.bfdForStaticRoutesDisabledOnResources; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vlanId property: Vlan identifier. Example: 1001. + * + * @return the vlanId value. + */ + public int vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: Vlan identifier. Example: 1001. + * + * @param vlanId the vlanId value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withVlanId(int vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: Maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @param connectedIPv4Subnets the connectedIPv4Subnets value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + this.connectedIPv4Subnets = connectedIPv4Subnets; + return this; + } + + /** + * Get the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @param connectedIPv6Subnets the connectedIPv6Subnets value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + this.connectedIPv6Subnets = connectedIPv6Subnets; + return this; + } + + /** + * Get the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.bgpConfiguration; + } + + /** + * Set the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration the bgpConfiguration value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + this.bgpConfiguration = bgpConfiguration; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** {@inheritDoc} */ + @Override + public InternalNetworkProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (connectedIPv4Subnets() != null) { + connectedIPv4Subnets().forEach(e -> e.validate()); + } + if (connectedIPv6Subnets() != null) { + connectedIPv6Subnets().forEach(e -> e.validate()); + } + if (staticRouteConfiguration() != null) { + staticRouteConfiguration().validate(); + } + if (bgpConfiguration() != null) { + bgpConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListInner.java new file mode 100644 index 000000000000..12d1d55ac155 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListInner.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.GshutBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.InternetBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpCommunityList resource definition. */ +@Fluent +public final class IpCommunityListInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private IpCommunityListProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of IpCommunityListInner class. */ + public IpCommunityListInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpCommunityListProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public CommunityActionType action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withAction(CommunityActionType action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the localAS property: Local Autonomous System. Example: true | false. + * + * @return the localAS value. + */ + public LocalASBoolean localAS() { + return this.innerProperties() == null ? null : this.innerProperties().localAS(); + } + + /** + * Set the localAS property: Local Autonomous System. Example: true | false. + * + * @param localAS the localAS value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withLocalAS(LocalASBoolean localAS) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withLocalAS(localAS); + return this; + } + + /** + * Get the gshut property: Graceful Shutdown (GSHUT). Example: true | false. + * + * @return the gshut value. + */ + public GshutBoolean gshut() { + return this.innerProperties() == null ? null : this.innerProperties().gshut(); + } + + /** + * Set the gshut property: Graceful Shutdown (GSHUT). Example: true | false. + * + * @param gshut the gshut value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withGshut(GshutBoolean gshut) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withGshut(gshut); + return this; + } + + /** + * Get the internet property: Internet access. Example: true | false. + * + * @return the internet value. + */ + public InternetBoolean internet() { + return this.innerProperties() == null ? null : this.innerProperties().internet(); + } + + /** + * Set the internet property: Internet access. Example: true | false. + * + * @param internet the internet value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withInternet(InternetBoolean internet) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withInternet(internet); + return this; + } + + /** + * Get the advertise property: noAdvertise. Example: true | false. + * + * @return the advertise value. + */ + public AdvertiseBoolean advertise() { + return this.innerProperties() == null ? null : this.innerProperties().advertise(); + } + + /** + * Set the advertise property: noAdvertise. Example: true | false. + * + * @param advertise the advertise value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withAdvertise(AdvertiseBoolean advertise) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withAdvertise(advertise); + return this; + } + + /** + * Get the export property: noExport. Example: true | false. + * + * @return the export value. + */ + public ExportBoolean export() { + return this.innerProperties() == null ? null : this.innerProperties().export(); + } + + /** + * Set the export property: noExport. Example: true | false. + * + * @param export the export value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withExport(ExportBoolean export) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withExport(export); + return this; + } + + /** + * Get the communityMembers property: Ip Community List communityMembers. + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.innerProperties() == null ? null : this.innerProperties().communityMembers(); + } + + /** + * Set the communityMembers property: Ip Community List communityMembers. + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withCommunityMembers( + List communityMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withCommunityMembers(communityMembers); + return this; + } + + /** + * Get the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @return the evpnEsImportRouteTargets value. + */ + public List evpnEsImportRouteTargets() { + return this.innerProperties() == null ? null : this.innerProperties().evpnEsImportRouteTargets(); + } + + /** + * Set the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @param evpnEsImportRouteTargets the evpnEsImportRouteTargets value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withEvpnEsImportRouteTargets(evpnEsImportRouteTargets); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the IpCommunityListInner object itself. + */ + public IpCommunityListInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListPatchProperties.java new file mode 100644 index 000000000000..120ba9ae77b0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListPatchProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatchPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IpCommunityListPatch define the patchable resource properties. */ +@Fluent +public final class IpCommunityListPatchProperties extends AnnotationResource { + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action") + private CommunityActionType action; + + /* + * Local Autonomous System. Example: true | false. + */ + @JsonProperty(value = "localAS") + private LocalASBoolean localAS; + + /* + * noAdvertise. Example: true | false. + */ + @JsonProperty(value = "advertise") + private AdvertiseBoolean advertise; + + /* + * noExport. Example: true | false. + */ + @JsonProperty(value = "export") + private ExportBoolean export; + + /* + * Ip Community List communityMembers. + */ + @JsonProperty(value = "communityMembers") + private List communityMembers; + + /* + * Ip Community List evpnEsImportRouteTargets. + */ + @JsonProperty(value = "evpnEsImportRouteTargets") + private List evpnEsImportRouteTargets; + + /** Creates an instance of IpCommunityListPatchProperties class. */ + public IpCommunityListPatchProperties() { + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public CommunityActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withAction(CommunityActionType action) { + this.action = action; + return this; + } + + /** + * Get the localAS property: Local Autonomous System. Example: true | false. + * + * @return the localAS value. + */ + public LocalASBoolean localAS() { + return this.localAS; + } + + /** + * Set the localAS property: Local Autonomous System. Example: true | false. + * + * @param localAS the localAS value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withLocalAS(LocalASBoolean localAS) { + this.localAS = localAS; + return this; + } + + /** + * Get the advertise property: noAdvertise. Example: true | false. + * + * @return the advertise value. + */ + public AdvertiseBoolean advertise() { + return this.advertise; + } + + /** + * Set the advertise property: noAdvertise. Example: true | false. + * + * @param advertise the advertise value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withAdvertise(AdvertiseBoolean advertise) { + this.advertise = advertise; + return this; + } + + /** + * Get the export property: noExport. Example: true | false. + * + * @return the export value. + */ + public ExportBoolean export() { + return this.export; + } + + /** + * Set the export property: noExport. Example: true | false. + * + * @param export the export value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withExport(ExportBoolean export) { + this.export = export; + return this; + } + + /** + * Get the communityMembers property: Ip Community List communityMembers. + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.communityMembers; + } + + /** + * Set the communityMembers property: Ip Community List communityMembers. + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withCommunityMembers( + List communityMembers) { + this.communityMembers = communityMembers; + return this; + } + + /** + * Get the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @return the evpnEsImportRouteTargets value. + */ + public List evpnEsImportRouteTargets() { + return this.evpnEsImportRouteTargets; + } + + /** + * Set the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @param evpnEsImportRouteTargets the evpnEsImportRouteTargets value to set. + * @return the IpCommunityListPatchProperties object itself. + */ + public IpCommunityListPatchProperties withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets) { + this.evpnEsImportRouteTargets = evpnEsImportRouteTargets; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (communityMembers() != null) { + communityMembers().forEach(e -> e.validate()); + } + if (evpnEsImportRouteTargets() != null) { + evpnEsImportRouteTargets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListProperties.java new file mode 100644 index 000000000000..b6f50aa9cab5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityListProperties.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.GshutBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.InternetBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IpCommunityListProperties define the resource properties. */ +@Fluent +public final class IpCommunityListProperties extends AnnotationResource { + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action", required = true) + private CommunityActionType action; + + /* + * Local Autonomous System. Example: true | false. + */ + @JsonProperty(value = "localAS", required = true) + private LocalASBoolean localAS; + + /* + * Graceful Shutdown (GSHUT). Example: true | false. + */ + @JsonProperty(value = "gshut") + private GshutBoolean gshut; + + /* + * Internet access. Example: true | false. + */ + @JsonProperty(value = "internet") + private InternetBoolean internet; + + /* + * noAdvertise. Example: true | false. + */ + @JsonProperty(value = "advertise", required = true) + private AdvertiseBoolean advertise; + + /* + * noExport. Example: true | false. + */ + @JsonProperty(value = "export", required = true) + private ExportBoolean export; + + /* + * Ip Community List communityMembers. + */ + @JsonProperty(value = "communityMembers") + private List communityMembers; + + /* + * Ip Community List evpnEsImportRouteTargets. + */ + @JsonProperty(value = "evpnEsImportRouteTargets") + private List evpnEsImportRouteTargets; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of IpCommunityListProperties class. */ + public IpCommunityListProperties() { + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public CommunityActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withAction(CommunityActionType action) { + this.action = action; + return this; + } + + /** + * Get the localAS property: Local Autonomous System. Example: true | false. + * + * @return the localAS value. + */ + public LocalASBoolean localAS() { + return this.localAS; + } + + /** + * Set the localAS property: Local Autonomous System. Example: true | false. + * + * @param localAS the localAS value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withLocalAS(LocalASBoolean localAS) { + this.localAS = localAS; + return this; + } + + /** + * Get the gshut property: Graceful Shutdown (GSHUT). Example: true | false. + * + * @return the gshut value. + */ + public GshutBoolean gshut() { + return this.gshut; + } + + /** + * Set the gshut property: Graceful Shutdown (GSHUT). Example: true | false. + * + * @param gshut the gshut value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withGshut(GshutBoolean gshut) { + this.gshut = gshut; + return this; + } + + /** + * Get the internet property: Internet access. Example: true | false. + * + * @return the internet value. + */ + public InternetBoolean internet() { + return this.internet; + } + + /** + * Set the internet property: Internet access. Example: true | false. + * + * @param internet the internet value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withInternet(InternetBoolean internet) { + this.internet = internet; + return this; + } + + /** + * Get the advertise property: noAdvertise. Example: true | false. + * + * @return the advertise value. + */ + public AdvertiseBoolean advertise() { + return this.advertise; + } + + /** + * Set the advertise property: noAdvertise. Example: true | false. + * + * @param advertise the advertise value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withAdvertise(AdvertiseBoolean advertise) { + this.advertise = advertise; + return this; + } + + /** + * Get the export property: noExport. Example: true | false. + * + * @return the export value. + */ + public ExportBoolean export() { + return this.export; + } + + /** + * Set the export property: noExport. Example: true | false. + * + * @param export the export value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withExport(ExportBoolean export) { + this.export = export; + return this; + } + + /** + * Get the communityMembers property: Ip Community List communityMembers. + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.communityMembers; + } + + /** + * Set the communityMembers property: Ip Community List communityMembers. + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withCommunityMembers( + List communityMembers) { + this.communityMembers = communityMembers; + return this; + } + + /** + * Get the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @return the evpnEsImportRouteTargets value. + */ + public List evpnEsImportRouteTargets() { + return this.evpnEsImportRouteTargets; + } + + /** + * Set the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @param evpnEsImportRouteTargets the evpnEsImportRouteTargets value to set. + * @return the IpCommunityListProperties object itself. + */ + public IpCommunityListProperties withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets) { + this.evpnEsImportRouteTargets = evpnEsImportRouteTargets; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model IpCommunityListProperties")); + } + if (localAS() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localAS in model IpCommunityListProperties")); + } + if (advertise() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property advertise in model IpCommunityListProperties")); + } + if (export() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property export in model IpCommunityListProperties")); + } + if (communityMembers() != null) { + communityMembers().forEach(e -> e.validate()); + } + if (evpnEsImportRouteTargets() != null) { + evpnEsImportRouteTargets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpCommunityListProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListInner.java new file mode 100644 index 000000000000..4f9e0f1282a1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListInner.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.managednetworkfabric.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.managednetworkfabric.models.PrefixActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IpPrefixList resource definition. */ +@Fluent +public final class IpPrefixListInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private IpPrefixListProperties innerProperties = new IpPrefixListProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of IpPrefixListInner class. */ + public IpPrefixListInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpPrefixListProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public IpPrefixListInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpPrefixListInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public PrefixActionType action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpPrefixListInner object itself. + */ + public IpPrefixListInner withAction(PrefixActionType action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @return the sequenceNumber value. + */ + public int sequenceNumber() { + return this.innerProperties() == null ? 0 : this.innerProperties().sequenceNumber(); + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the IpPrefixListInner object itself. + */ + public IpPrefixListInner withSequenceNumber(int sequenceNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListProperties(); + } + this.innerProperties().withSequenceNumber(sequenceNumber); + return this; + } + + /** + * Get the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @return the networkAddress value. + */ + public String networkAddress() { + return this.innerProperties() == null ? null : this.innerProperties().networkAddress(); + } + + /** + * Set the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @param networkAddress the networkAddress value to set. + * @return the IpPrefixListInner object itself. + */ + public IpPrefixListInner withNetworkAddress(String networkAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListProperties(); + } + this.innerProperties().withNetworkAddress(networkAddress); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the IpPrefixListInner object itself. + */ + public IpPrefixListInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 IpPrefixListInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixListInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListPatchProperties.java new file mode 100644 index 000000000000..08e0d1a8278d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListPatchProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.PrefixActionType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpPrefixListPatchProperties define the patchable resource properties. */ +@Fluent +public final class IpPrefixListPatchProperties extends AnnotationResource { + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action") + private PrefixActionType action; + + /* + * sequenceNumber of the Ip Prefix List. + */ + @JsonProperty(value = "sequenceNumber") + private Integer sequenceNumber; + + /* + * networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + */ + @JsonProperty(value = "networkAddress") + private String networkAddress; + + /** Creates an instance of IpPrefixListPatchProperties class. */ + public IpPrefixListPatchProperties() { + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public PrefixActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpPrefixListPatchProperties object itself. + */ + public IpPrefixListPatchProperties withAction(PrefixActionType action) { + this.action = action; + return this; + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @return the sequenceNumber value. + */ + public Integer sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the IpPrefixListPatchProperties object itself. + */ + public IpPrefixListPatchProperties withSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @return the networkAddress value. + */ + public String networkAddress() { + return this.networkAddress; + } + + /** + * Set the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @param networkAddress the networkAddress value to set. + * @return the IpPrefixListPatchProperties object itself. + */ + public IpPrefixListPatchProperties withNetworkAddress(String networkAddress) { + this.networkAddress = networkAddress; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpPrefixListPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListProperties.java new file mode 100644 index 000000000000..23e92a9636a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixListProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.PrefixActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpPrefixListProperties define the resource properties. */ +@Fluent +public final class IpPrefixListProperties extends AnnotationResource { + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action", required = true) + private PrefixActionType action; + + /* + * sequenceNumber of the Ip Prefix List. + */ + @JsonProperty(value = "sequenceNumber", required = true) + private int sequenceNumber; + + /* + * networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + */ + @JsonProperty(value = "networkAddress", required = true) + private String networkAddress; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of IpPrefixListProperties class. */ + public IpPrefixListProperties() { + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public PrefixActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpPrefixListProperties object itself. + */ + public IpPrefixListProperties withAction(PrefixActionType action) { + this.action = action; + return this; + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @return the sequenceNumber value. + */ + public int sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the IpPrefixListProperties object itself. + */ + public IpPrefixListProperties withSequenceNumber(int sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @return the networkAddress value. + */ + public String networkAddress() { + return this.networkAddress; + } + + /** + * Set the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @param networkAddress the networkAddress value to set. + * @return the IpPrefixListProperties object itself. + */ + public IpPrefixListProperties withNetworkAddress(String networkAddress) { + this.networkAddress = networkAddress; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IpPrefixListProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model IpPrefixListProperties")); + } + if (networkAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkAddress in model IpPrefixListProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixListProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainInner.java new file mode 100644 index 000000000000..f971807ec1e0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainInner.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The L2IsolationDomain resource definition. */ +@Fluent +public final class L2IsolationDomainInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private L2IsolationDomainProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of L2IsolationDomainInner class. */ + public L2IsolationDomainInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private L2IsolationDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public L2IsolationDomainInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public L2IsolationDomainInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricId(); + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the L2IsolationDomainInner object itself. + */ + public L2IsolationDomainInner withNetworkFabricId(String networkFabricId) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainProperties(); + } + this.innerProperties().withNetworkFabricId(networkFabricId); + return this; + } + + /** + * Get the vlanId property: vlanId. Example: 501. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.innerProperties() == null ? null : this.innerProperties().vlanId(); + } + + /** + * Set the vlanId property: vlanId. Example: 501. + * + * @param vlanId the vlanId value to set. + * @return the L2IsolationDomainInner object itself. + */ + public L2IsolationDomainInner withVlanId(Integer vlanId) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainProperties(); + } + this.innerProperties().withVlanId(vlanId); + return this; + } + + /** + * Get the mtu property: maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.innerProperties() == null ? null : this.innerProperties().mtu(); + } + + /** + * Set the mtu property: maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the L2IsolationDomainInner object itself. + */ + public L2IsolationDomainInner withMtu(Integer mtu) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainProperties(); + } + this.innerProperties().withMtu(mtu); + return this; + } + + /** + * Get the disabledOnResources property: List of resources the L2 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().disabledOnResources(); + } + + /** + * Get the administrativeState property: state. Example: Enabled | Disabled. It indicates administrative state of + * the isolationDomain, whether it is enabled or disabled. If enabled, the configuration is applied on the devices. + * If disabled, the configuration is removed from the devices. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the L2IsolationDomainInner object itself. + */ + public L2IsolationDomainInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainPatchProperties.java new file mode 100644 index 000000000000..420d1daab264 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainPatchProperties.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** L2IsolationDomainPatchProperties define the patchable resource properties. */ +@Fluent +public final class L2IsolationDomainPatchProperties extends AnnotationResource { + /* + * maximum transmission unit. Default value is 1500. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /** Creates an instance of L2IsolationDomainPatchProperties class. */ + public L2IsolationDomainPatchProperties() { + } + + /** + * Get the mtu property: maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the L2IsolationDomainPatchProperties object itself. + */ + public L2IsolationDomainPatchProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** {@inheritDoc} */ + @Override + public L2IsolationDomainPatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainProperties.java new file mode 100644 index 000000000000..02f0e2089c73 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L2IsolationDomainProperties define the resource properties. */ +@Fluent +public final class L2IsolationDomainProperties extends AnnotationResource { + /* + * Network Fabric ARM resource id. + */ + @JsonProperty(value = "networkFabricId", required = true) + private String networkFabricId; + + /* + * vlanId. Example: 501. + */ + @JsonProperty(value = "vlanId", required = true) + private int vlanId; + + /* + * maximum transmission unit. Default value is 1500. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * List of resources the L2 Isolation Domain is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "disabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List disabledOnResources; + + /* + * state. Example: Enabled | Disabled. It indicates administrative state of the isolationDomain, whether it is + * enabled or disabled. If enabled, the configuration is applied on the devices. If disabled, the configuration is + * removed from the devices + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of L2IsolationDomainProperties class. */ + public L2IsolationDomainProperties() { + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.networkFabricId; + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the L2IsolationDomainProperties object itself. + */ + public L2IsolationDomainProperties withNetworkFabricId(String networkFabricId) { + this.networkFabricId = networkFabricId; + return this; + } + + /** + * Get the vlanId property: vlanId. Example: 501. + * + * @return the vlanId value. + */ + public int vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: vlanId. Example: 501. + * + * @param vlanId the vlanId value to set. + * @return the L2IsolationDomainProperties object itself. + */ + public L2IsolationDomainProperties withVlanId(int vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the mtu property: maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the L2IsolationDomainProperties object itself. + */ + public L2IsolationDomainProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the disabledOnResources property: List of resources the L2 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.disabledOnResources; + } + + /** + * Get the administrativeState property: state. Example: Enabled | Disabled. It indicates administrative state of + * the isolationDomain, whether it is enabled or disabled. If enabled, the configuration is applied on the devices. + * If disabled, the configuration is removed from the devices. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public L2IsolationDomainProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricId in model L2IsolationDomainProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L2IsolationDomainProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainInner.java new file mode 100644 index 000000000000..2c93a779939d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainInner.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The L3IsolationDomain resource definition. */ +@Fluent +public final class L3IsolationDomainInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private L3IsolationDomainProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of L3IsolationDomainInner class. */ + public L3IsolationDomainInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private L3IsolationDomainProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public L3IsolationDomainInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public L3IsolationDomainInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricId(); + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withNetworkFabricId(String networkFabricId) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withNetworkFabricId(networkFabricId); + return this; + } + + /** + * Get the disabledOnResources property: List of resources the L3 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().disabledOnResources(); + } + + /** + * Get the administrativeState property: Administrative state of the IsolationDomain. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the optionBDisabledOnResources property: List of resources the OptionB is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the optionBDisabledOnResources value. + */ + public List optionBDisabledOnResources() { + return this.innerProperties() == null ? null : this.innerProperties().optionBDisabledOnResources(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @return the redistributeConnectedSubnets value. + */ + public RedistributeConnectedSubnets redistributeConnectedSubnets() { + return this.innerProperties() == null ? null : this.innerProperties().redistributeConnectedSubnets(); + } + + /** + * Set the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @param redistributeConnectedSubnets the redistributeConnectedSubnets value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withRedistributeConnectedSubnets( + RedistributeConnectedSubnets redistributeConnectedSubnets) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withRedistributeConnectedSubnets(redistributeConnectedSubnets); + return this; + } + + /** + * Get the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @return the redistributeStaticRoutes value. + */ + public RedistributeStaticRoutes redistributeStaticRoutes() { + return this.innerProperties() == null ? null : this.innerProperties().redistributeStaticRoutes(); + } + + /** + * Set the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @param redistributeStaticRoutes the redistributeStaticRoutes value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withRedistributeStaticRoutes(redistributeStaticRoutes); + return this; + } + + /** + * Get the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @return the aggregateRouteConfiguration value. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateRouteConfiguration(); + } + + /** + * Set the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @param aggregateRouteConfiguration the aggregateRouteConfiguration value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withAggregateRouteConfiguration(aggregateRouteConfiguration); + return this; + } + + /** + * Get the description property: L3 Isolation Domain description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: L3 Isolation Domain description. + * + * @param description the description value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @return the connectedSubnetRoutePolicy value. + */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().connectedSubnetRoutePolicy(); + } + + /** + * Set the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy the connectedSubnetRoutePolicy value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withConnectedSubnetRoutePolicy(connectedSubnetRoutePolicy); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the L3IsolationDomainInner object itself. + */ + public L3IsolationDomainInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainPatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainPatchProperties.java new file mode 100644 index 000000000000..54ba7909bfcc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainPatchProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** L3IsolationDomainPatchProperties define the patch resource properties. */ +@Fluent +public class L3IsolationDomainPatchProperties { + /* + * Advertise Connected Subnets. Ex: "True" | "False". + */ + @JsonProperty(value = "redistributeConnectedSubnets") + private RedistributeConnectedSubnets redistributeConnectedSubnets; + + /* + * Advertise Static Routes. Ex: "True" | "False". + */ + @JsonProperty(value = "redistributeStaticRoutes") + private RedistributeStaticRoutes redistributeStaticRoutes; + + /* + * List of Ipv4 and Ipv6 route configurations. + */ + @JsonProperty(value = "aggregateRouteConfiguration") + private L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration; + + /* + * L3 Isolation Domain description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Connected Subnet RoutePolicy + */ + @JsonProperty(value = "connectedSubnetRoutePolicy") + private L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy; + + /** Creates an instance of L3IsolationDomainPatchProperties class. */ + public L3IsolationDomainPatchProperties() { + } + + /** + * Get the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @return the redistributeConnectedSubnets value. + */ + public RedistributeConnectedSubnets redistributeConnectedSubnets() { + return this.redistributeConnectedSubnets; + } + + /** + * Set the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @param redistributeConnectedSubnets the redistributeConnectedSubnets value to set. + * @return the L3IsolationDomainPatchProperties object itself. + */ + public L3IsolationDomainPatchProperties withRedistributeConnectedSubnets( + RedistributeConnectedSubnets redistributeConnectedSubnets) { + this.redistributeConnectedSubnets = redistributeConnectedSubnets; + return this; + } + + /** + * Get the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @return the redistributeStaticRoutes value. + */ + public RedistributeStaticRoutes redistributeStaticRoutes() { + return this.redistributeStaticRoutes; + } + + /** + * Set the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @param redistributeStaticRoutes the redistributeStaticRoutes value to set. + * @return the L3IsolationDomainPatchProperties object itself. + */ + public L3IsolationDomainPatchProperties withRedistributeStaticRoutes( + RedistributeStaticRoutes redistributeStaticRoutes) { + this.redistributeStaticRoutes = redistributeStaticRoutes; + return this; + } + + /** + * Get the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @return the aggregateRouteConfiguration value. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration() { + return this.aggregateRouteConfiguration; + } + + /** + * Set the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @param aggregateRouteConfiguration the aggregateRouteConfiguration value to set. + * @return the L3IsolationDomainPatchProperties object itself. + */ + public L3IsolationDomainPatchProperties withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration) { + this.aggregateRouteConfiguration = aggregateRouteConfiguration; + return this; + } + + /** + * Get the description property: L3 Isolation Domain description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: L3 Isolation Domain description. + * + * @param description the description value to set. + * @return the L3IsolationDomainPatchProperties object itself. + */ + public L3IsolationDomainPatchProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @return the connectedSubnetRoutePolicy value. + */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy() { + return this.connectedSubnetRoutePolicy; + } + + /** + * Set the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy the connectedSubnetRoutePolicy value to set. + * @return the L3IsolationDomainPatchProperties object itself. + */ + public L3IsolationDomainPatchProperties withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) { + this.connectedSubnetRoutePolicy = connectedSubnetRoutePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregateRouteConfiguration() != null) { + aggregateRouteConfiguration().validate(); + } + if (connectedSubnetRoutePolicy() != null) { + connectedSubnetRoutePolicy().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainProperties.java new file mode 100644 index 000000000000..98d0ed384532 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainProperties.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L3IsolationDomainProperties define the resource properties. */ +@Fluent +public final class L3IsolationDomainProperties extends AnnotationResource { + /* + * Network Fabric ARM resource id. + */ + @JsonProperty(value = "networkFabricId", required = true) + private String networkFabricId; + + /* + * List of resources the L3 Isolation Domain is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "disabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List disabledOnResources; + + /* + * Administrative state of the IsolationDomain. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * List of resources the OptionB is disabled on. Can be either entire NetworkFabric or NetworkRack. + */ + @JsonProperty(value = "optionBDisabledOnResources", access = JsonProperty.Access.WRITE_ONLY) + private List optionBDisabledOnResources; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Advertise Connected Subnets. Ex: "True" | "False". + */ + @JsonProperty(value = "redistributeConnectedSubnets") + private RedistributeConnectedSubnets redistributeConnectedSubnets; + + /* + * Advertise Static Routes. Ex: "True" | "False". + */ + @JsonProperty(value = "redistributeStaticRoutes") + private RedistributeStaticRoutes redistributeStaticRoutes; + + /* + * List of Ipv4 and Ipv6 route configurations. + */ + @JsonProperty(value = "aggregateRouteConfiguration") + private L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration; + + /* + * L3 Isolation Domain description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Connected Subnet RoutePolicy + */ + @JsonProperty(value = "connectedSubnetRoutePolicy") + private L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy; + + /** Creates an instance of L3IsolationDomainProperties class. */ + public L3IsolationDomainProperties() { + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.networkFabricId; + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withNetworkFabricId(String networkFabricId) { + this.networkFabricId = networkFabricId; + return this; + } + + /** + * Get the disabledOnResources property: List of resources the L3 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + public List disabledOnResources() { + return this.disabledOnResources; + } + + /** + * Get the administrativeState property: Administrative state of the IsolationDomain. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the optionBDisabledOnResources property: List of resources the OptionB is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the optionBDisabledOnResources value. + */ + public List optionBDisabledOnResources() { + return this.optionBDisabledOnResources; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @return the redistributeConnectedSubnets value. + */ + public RedistributeConnectedSubnets redistributeConnectedSubnets() { + return this.redistributeConnectedSubnets; + } + + /** + * Set the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @param redistributeConnectedSubnets the redistributeConnectedSubnets value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withRedistributeConnectedSubnets( + RedistributeConnectedSubnets redistributeConnectedSubnets) { + this.redistributeConnectedSubnets = redistributeConnectedSubnets; + return this; + } + + /** + * Get the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @return the redistributeStaticRoutes value. + */ + public RedistributeStaticRoutes redistributeStaticRoutes() { + return this.redistributeStaticRoutes; + } + + /** + * Set the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @param redistributeStaticRoutes the redistributeStaticRoutes value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes) { + this.redistributeStaticRoutes = redistributeStaticRoutes; + return this; + } + + /** + * Get the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @return the aggregateRouteConfiguration value. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration() { + return this.aggregateRouteConfiguration; + } + + /** + * Set the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @param aggregateRouteConfiguration the aggregateRouteConfiguration value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration) { + this.aggregateRouteConfiguration = aggregateRouteConfiguration; + return this; + } + + /** + * Get the description property: L3 Isolation Domain description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: L3 Isolation Domain description. + * + * @param description the description value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @return the connectedSubnetRoutePolicy value. + */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy() { + return this.connectedSubnetRoutePolicy; + } + + /** + * Set the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy the connectedSubnetRoutePolicy value to set. + * @return the L3IsolationDomainProperties object itself. + */ + public L3IsolationDomainProperties withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) { + this.connectedSubnetRoutePolicy = connectedSubnetRoutePolicy; + return this; + } + + /** {@inheritDoc} */ + @Override + public L3IsolationDomainProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricId in model L3IsolationDomainProperties")); + } + if (aggregateRouteConfiguration() != null) { + aggregateRouteConfiguration().validate(); + } + if (connectedSubnetRoutePolicy() != null) { + connectedSubnetRoutePolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L3IsolationDomainProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceInner.java new file mode 100644 index 000000000000..098dce484472 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NetworkDevice resource definition. */ +@Fluent +public final class NetworkDeviceInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private NetworkDeviceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkDeviceInner class. */ + public NetworkDeviceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkDeviceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkDeviceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkDeviceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the version property: Current version of the device as defined in SKU. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the networkDeviceSku property: Network Device SKU name. + * + * @return the networkDeviceSku value. + */ + public String networkDeviceSku() { + return this.innerProperties() == null ? null : this.innerProperties().networkDeviceSku(); + } + + /** + * Set the networkDeviceSku property: Network Device SKU name. + * + * @param networkDeviceSku the networkDeviceSku value to set. + * @return the NetworkDeviceInner object itself. + */ + public NetworkDeviceInner withNetworkDeviceSku(String networkDeviceSku) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceProperties(); + } + this.innerProperties().withNetworkDeviceSku(networkDeviceSku); + return this; + } + + /** + * Get the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR. + * + * @return the networkDeviceRole value. + */ + public NetworkDeviceRoleTypes networkDeviceRole() { + return this.innerProperties() == null ? null : this.innerProperties().networkDeviceRole(); + } + + /** + * Set the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR. + * + * @param networkDeviceRole the networkDeviceRole value to set. + * @return the NetworkDeviceInner object itself. + */ + public NetworkDeviceInner withNetworkDeviceRole(NetworkDeviceRoleTypes networkDeviceRole) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceProperties(); + } + this.innerProperties().withNetworkDeviceRole(networkDeviceRole); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the networkRackId property: Reference to network rack resource id. + * + * @return the networkRackId value. + */ + public String networkRackId() { + return this.innerProperties() == null ? null : this.innerProperties().networkRackId(); + } + + /** + * Get the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host Name of the device. + * + * @param hostname the hostname value to set. + * @return the NetworkDeviceInner object itself. + */ + public NetworkDeviceInner withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Set the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkDeviceInner object itself. + */ + public NetworkDeviceInner withSerialNumber(String serialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceProperties(); + } + this.innerProperties().withSerialNumber(serialNumber); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkDeviceInner object itself. + */ + public NetworkDeviceInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDevicePatchParametersProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDevicePatchParametersProperties.java new file mode 100644 index 000000000000..99675999a9bb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDevicePatchParametersProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Device Patch properties. */ +@Fluent +public final class NetworkDevicePatchParametersProperties extends AnnotationResource { + /* + * The host Name of the device. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969 + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of NetworkDevicePatchParametersProperties class. */ + public NetworkDevicePatchParametersProperties() { + } + + /** + * Get the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host Name of the device. + * + * @param hostname the hostname value to set. + * @return the NetworkDevicePatchParametersProperties object itself. + */ + public NetworkDevicePatchParametersProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkDevicePatchParametersProperties object itself. + */ + public NetworkDevicePatchParametersProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkDevicePatchParametersProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceProperties.java new file mode 100644 index 000000000000..86357c3a791f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NetworkDeviceProperties define the resource properties. */ +@Fluent +public final class NetworkDeviceProperties extends AnnotationResource { + /* + * Current version of the device as defined in SKU. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Network Device SKU name. + */ + @JsonProperty(value = "networkDeviceSku", required = true) + private String networkDeviceSku; + + /* + * networkDeviceRole is the device role: Example: CE | ToR. + */ + @JsonProperty(value = "networkDeviceRole", required = true) + private NetworkDeviceRoleTypes networkDeviceRole; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Reference to network rack resource id. + */ + @JsonProperty(value = "networkRackId", access = JsonProperty.Access.WRITE_ONLY) + private String networkRackId; + + /* + * The host Name of the device. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969 + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of NetworkDeviceProperties class. */ + public NetworkDeviceProperties() { + } + + /** + * Get the version property: Current version of the device as defined in SKU. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the networkDeviceSku property: Network Device SKU name. + * + * @return the networkDeviceSku value. + */ + public String networkDeviceSku() { + return this.networkDeviceSku; + } + + /** + * Set the networkDeviceSku property: Network Device SKU name. + * + * @param networkDeviceSku the networkDeviceSku value to set. + * @return the NetworkDeviceProperties object itself. + */ + public NetworkDeviceProperties withNetworkDeviceSku(String networkDeviceSku) { + this.networkDeviceSku = networkDeviceSku; + return this; + } + + /** + * Get the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR. + * + * @return the networkDeviceRole value. + */ + public NetworkDeviceRoleTypes networkDeviceRole() { + return this.networkDeviceRole; + } + + /** + * Set the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR. + * + * @param networkDeviceRole the networkDeviceRole value to set. + * @return the NetworkDeviceProperties object itself. + */ + public NetworkDeviceProperties withNetworkDeviceRole(NetworkDeviceRoleTypes networkDeviceRole) { + this.networkDeviceRole = networkDeviceRole; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the networkRackId property: Reference to network rack resource id. + * + * @return the networkRackId value. + */ + public String networkRackId() { + return this.networkRackId; + } + + /** + * Get the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host Name of the device. + * + * @param hostname the hostname value to set. + * @return the NetworkDeviceProperties object itself. + */ + public NetworkDeviceProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkDeviceProperties object itself. + */ + public NetworkDeviceProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkDeviceProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkDeviceSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkDeviceSku in model NetworkDeviceProperties")); + } + if (networkDeviceRole() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkDeviceRole in model NetworkDeviceProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkDeviceProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java new file mode 100644 index 000000000000..5b8c814918e8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesInterfacesItem; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesSupportedVersionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NetworkDeviceSku resource definition. */ +@Fluent +public final class NetworkDeviceSkuInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private NetworkDeviceSkuProperties innerProperties = new NetworkDeviceSkuProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkDeviceSkuInner class. */ + public NetworkDeviceSkuInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkDeviceSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the model property: Model of the network device. + * + * @return the model value. + */ + public String model() { + return this.innerProperties() == null ? null : this.innerProperties().model(); + } + + /** + * Set the model property: Model of the network device. + * + * @param model the model value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withModel(String model) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withModel(model); + return this; + } + + /** + * Get the manufacturer property: Manufacturer of the network device. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.innerProperties() == null ? null : this.innerProperties().manufacturer(); + } + + /** + * Set the manufacturer property: Manufacturer of the network device. + * + * @param manufacturer the manufacturer value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withManufacturer(String manufacturer) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withManufacturer(manufacturer); + return this; + } + + /** + * Get the supportedVersions property: List of network device interfaces. + * + * @return the supportedVersions value. + */ + public List supportedVersions() { + return this.innerProperties() == null ? null : this.innerProperties().supportedVersions(); + } + + /** + * Set the supportedVersions property: List of network device interfaces. + * + * @param supportedVersions the supportedVersions value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withSupportedVersions( + List supportedVersions) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withSupportedVersions(supportedVersions); + return this; + } + + /** + * Get the limits property: Network device limits. + * + * @return the limits value. + */ + public NetworkDeviceSkuPropertiesLimits limits() { + return this.innerProperties() == null ? null : this.innerProperties().limits(); + } + + /** + * Set the limits property: Network device limits. + * + * @param limits the limits value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withLimits(NetworkDeviceSkuPropertiesLimits limits) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withLimits(limits); + return this; + } + + /** + * Get the supportedRoleTypes property: Available roles for the network device. + * + * @return the supportedRoleTypes value. + */ + public List supportedRoleTypes() { + return this.innerProperties() == null ? null : this.innerProperties().supportedRoleTypes(); + } + + /** + * Set the supportedRoleTypes property: Available roles for the network device. + * + * @param supportedRoleTypes the supportedRoleTypes value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withSupportedRoleTypes(List supportedRoleTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withSupportedRoleTypes(supportedRoleTypes); + return this; + } + + /** + * Get the interfaces property: List of network device interfaces. + * + * @return the interfaces value. + */ + public List interfaces() { + return this.innerProperties() == null ? null : this.innerProperties().interfaces(); + } + + /** + * Set the interfaces property: List of network device interfaces. + * + * @param interfaces the interfaces value to set. + * @return the NetworkDeviceSkuInner object itself. + */ + public NetworkDeviceSkuInner withInterfaces(List interfaces) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDeviceSkuProperties(); + } + this.innerProperties().withInterfaces(interfaces); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * 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 NetworkDeviceSkuInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkDeviceSkuInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuProperties.java new file mode 100644 index 000000000000..4be7933747f6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuProperties.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesInterfacesItem; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesSupportedVersionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkDeviceSkuProperties define the resource properties. */ +@Fluent +public final class NetworkDeviceSkuProperties { + /* + * Model of the network device. + */ + @JsonProperty(value = "model", required = true) + private String model; + + /* + * Manufacturer of the network device. + */ + @JsonProperty(value = "manufacturer") + private String manufacturer; + + /* + * List of network device interfaces. + */ + @JsonProperty(value = "supportedVersions") + private List supportedVersions; + + /* + * Network device limits. + */ + @JsonProperty(value = "limits") + private NetworkDeviceSkuPropertiesLimits limits; + + /* + * Available roles for the network device. + */ + @JsonProperty(value = "supportedRoleTypes") + private List supportedRoleTypes; + + /* + * List of network device interfaces. + */ + @JsonProperty(value = "interfaces") + private List interfaces; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of NetworkDeviceSkuProperties class. */ + public NetworkDeviceSkuProperties() { + } + + /** + * Get the model property: Model of the network device. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Set the model property: Model of the network device. + * + * @param model the model value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withModel(String model) { + this.model = model; + return this; + } + + /** + * Get the manufacturer property: Manufacturer of the network device. + * + * @return the manufacturer value. + */ + public String manufacturer() { + return this.manufacturer; + } + + /** + * Set the manufacturer property: Manufacturer of the network device. + * + * @param manufacturer the manufacturer value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + return this; + } + + /** + * Get the supportedVersions property: List of network device interfaces. + * + * @return the supportedVersions value. + */ + public List supportedVersions() { + return this.supportedVersions; + } + + /** + * Set the supportedVersions property: List of network device interfaces. + * + * @param supportedVersions the supportedVersions value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withSupportedVersions( + List supportedVersions) { + this.supportedVersions = supportedVersions; + return this; + } + + /** + * Get the limits property: Network device limits. + * + * @return the limits value. + */ + public NetworkDeviceSkuPropertiesLimits limits() { + return this.limits; + } + + /** + * Set the limits property: Network device limits. + * + * @param limits the limits value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withLimits(NetworkDeviceSkuPropertiesLimits limits) { + this.limits = limits; + return this; + } + + /** + * Get the supportedRoleTypes property: Available roles for the network device. + * + * @return the supportedRoleTypes value. + */ + public List supportedRoleTypes() { + return this.supportedRoleTypes; + } + + /** + * Set the supportedRoleTypes property: Available roles for the network device. + * + * @param supportedRoleTypes the supportedRoleTypes value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withSupportedRoleTypes(List supportedRoleTypes) { + this.supportedRoleTypes = supportedRoleTypes; + return this; + } + + /** + * Get the interfaces property: List of network device interfaces. + * + * @return the interfaces value. + */ + public List interfaces() { + return this.interfaces; + } + + /** + * Set the interfaces property: List of network device interfaces. + * + * @param interfaces the interfaces value to set. + * @return the NetworkDeviceSkuProperties object itself. + */ + public NetworkDeviceSkuProperties withInterfaces(List interfaces) { + this.interfaces = interfaces; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (model() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property model in model NetworkDeviceSkuProperties")); + } + if (supportedVersions() != null) { + supportedVersions().forEach(e -> e.validate()); + } + if (limits() != null) { + limits().validate(); + } + if (interfaces() != null) { + interfaces().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkDeviceSkuProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerInner.java new file mode 100644 index 000000000000..d6ac4a6b7706 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerInner.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesInfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesManagedResourceGroupConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesWorkloadServices; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The NetworkFabricController resource definition. */ +@Fluent +public final class NetworkFabricControllerInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private NetworkFabricControllerProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkFabricControllerInner class. */ + public NetworkFabricControllerInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkFabricControllerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricControllerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricControllerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the infrastructureServices property: InfrastructureServices IP ranges. + * + * @return the infrastructureServices value. + */ + public NetworkFabricControllerPropertiesInfrastructureServices infrastructureServices() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureServices(); + } + + /** + * Get the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + public NetworkFabricControllerPropertiesWorkloadServices workloadServices() { + return this.innerProperties() == null ? null : this.innerProperties().workloadServices(); + } + + /** + * Get the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withManagedResourceGroupConfiguration( + NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the networkFabricIds property: The NF-ID will be an input parameter used by the NF to link and get associated + * with the parent NFC Service. + * + * @return the networkFabricIds value. + */ + public List networkFabricIds() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricIds(); + } + + /** + * Get the workloadManagementNetwork property: A workload management network is required for all the tenant + * (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or + * any other MSFT/Public endpoints. + * + * @return the workloadManagementNetwork value. + */ + public Boolean workloadManagementNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().workloadManagementNetwork(); + } + + /** + * Get the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space. + * + * @return the ipv4AddressSpace value. + */ + public String ipv4AddressSpace() { + return this.innerProperties() == null ? null : this.innerProperties().ipv4AddressSpace(); + } + + /** + * Set the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space. + * + * @param ipv4AddressSpace the ipv4AddressSpace value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withIpv4AddressSpace(String ipv4AddressSpace) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withIpv4AddressSpace(ipv4AddressSpace); + return this; + } + + /** + * Get the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space. + * + * @return the ipv6AddressSpace value. + */ + public String ipv6AddressSpace() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6AddressSpace(); + } + + /** + * Set the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space. + * + * @param ipv6AddressSpace the ipv6AddressSpace value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withIpv6AddressSpace(String ipv6AddressSpace) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withIpv6AddressSpace(ipv6AddressSpace); + return this; + } + + /** + * Get the operationalState property: The Operational Status would always be NULL. Look only in to the Provisioning + * state for the latest status. + * + * @return the operationalState value. + */ + public NetworkFabricControllerOperationalState operationalState() { + return this.innerProperties() == null ? null : this.innerProperties().operationalState(); + } + + /** + * Get the provisioningState property: Provides you the latest status of the NFC service, whether it is Accepted, + * updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC + * provisioning. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @return the infrastructureExpressRouteConnections value. + */ + public List infrastructureExpressRouteConnections() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureExpressRouteConnections(); + } + + /** + * Set the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections the infrastructureExpressRouteConnections value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withInfrastructureExpressRouteConnections(infrastructureExpressRouteConnections); + return this; + } + + /** + * Get the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @return the workloadExpressRouteConnections value. + */ + public List workloadExpressRouteConnections() { + return this.innerProperties() == null ? null : this.innerProperties().workloadExpressRouteConnections(); + } + + /** + * Set the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @param workloadExpressRouteConnections the workloadExpressRouteConnections value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withWorkloadExpressRouteConnections(workloadExpressRouteConnections); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkFabricControllerInner object itself. + */ + public NetworkFabricControllerInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerPatchableProperties.java new file mode 100644 index 000000000000..0a6dfacff0da --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerPatchableProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Fabric Controller updatable properties. */ +@Fluent +public class NetworkFabricControllerPatchableProperties { + /* + * As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a + * NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute) + */ + @JsonProperty(value = "infrastructureExpressRouteConnections") + private List infrastructureExpressRouteConnections; + + /* + * As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This + * Express route is dedicated for Workload services. (This is a Mandatory attribute). + */ + @JsonProperty(value = "workloadExpressRouteConnections") + private List workloadExpressRouteConnections; + + /** Creates an instance of NetworkFabricControllerPatchableProperties class. */ + public NetworkFabricControllerPatchableProperties() { + } + + /** + * Get the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @return the infrastructureExpressRouteConnections value. + */ + public List infrastructureExpressRouteConnections() { + return this.infrastructureExpressRouteConnections; + } + + /** + * Set the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections the infrastructureExpressRouteConnections value to set. + * @return the NetworkFabricControllerPatchableProperties object itself. + */ + public NetworkFabricControllerPatchableProperties withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections) { + this.infrastructureExpressRouteConnections = infrastructureExpressRouteConnections; + return this; + } + + /** + * Get the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @return the workloadExpressRouteConnections value. + */ + public List workloadExpressRouteConnections() { + return this.workloadExpressRouteConnections; + } + + /** + * Set the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @param workloadExpressRouteConnections the workloadExpressRouteConnections value to set. + * @return the NetworkFabricControllerPatchableProperties object itself. + */ + public NetworkFabricControllerPatchableProperties withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections) { + this.workloadExpressRouteConnections = workloadExpressRouteConnections; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (infrastructureExpressRouteConnections() != null) { + infrastructureExpressRouteConnections().forEach(e -> e.validate()); + } + if (workloadExpressRouteConnections() != null) { + workloadExpressRouteConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerProperties.java new file mode 100644 index 000000000000..93b932a4af51 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerProperties.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesInfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesManagedResourceGroupConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesWorkloadServices; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkFabricControllerProperties define the resource properties. */ +@Fluent +public final class NetworkFabricControllerProperties extends AnnotationResource { + /* + * InfrastructureServices IP ranges. + */ + @JsonProperty(value = "infrastructureServices", access = JsonProperty.Access.WRITE_ONLY) + private NetworkFabricControllerPropertiesInfrastructureServices infrastructureServices; + + /* + * WorkloadServices IP ranges. + */ + @JsonProperty(value = "workloadServices", access = JsonProperty.Access.WRITE_ONLY) + private NetworkFabricControllerPropertiesWorkloadServices workloadServices; + + /* + * Managed Resource Group configuration properties. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * The NF-ID will be an input parameter used by the NF to link and get associated with the parent NFC Service. + */ + @JsonProperty(value = "networkFabricIds", access = JsonProperty.Access.WRITE_ONLY) + private List networkFabricIds; + + /* + * A workload management network is required for all the tenant (workload) traffic. This traffic is only dedicated + * for Tenant workloads which are required to access internet or any other MSFT/Public endpoints. + */ + @JsonProperty(value = "workloadManagementNetwork", access = JsonProperty.Access.WRITE_ONLY) + private Boolean workloadManagementNetwork; + + /* + * IPv4 Network Fabric Controller Address Space. + */ + @JsonProperty(value = "ipv4AddressSpace") + private String ipv4AddressSpace; + + /* + * IPv6 Network Fabric Controller Address Space. + */ + @JsonProperty(value = "ipv6AddressSpace") + private String ipv6AddressSpace; + + /* + * The Operational Status would always be NULL. Look only in to the Provisioning state for the latest status. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private NetworkFabricControllerOperationalState operationalState; + + /* + * Provides you the latest status of the NFC service, whether it is Accepted, updating, Succeeded or Failed. During + * this process, the states keep changing based on the status of NFC provisioning. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * As part of an update, the Infrastructure ExpressRoute CircuitID should be provided to create and Provision a + * NFC. This Express route is dedicated for Infrastructure services. (This is a Mandatory attribute) + */ + @JsonProperty(value = "infrastructureExpressRouteConnections") + private List infrastructureExpressRouteConnections; + + /* + * As part of an update, the workload ExpressRoute CircuitID should be provided to create and Provision a NFC. This + * Express route is dedicated for Workload services. (This is a Mandatory attribute). + */ + @JsonProperty(value = "workloadExpressRouteConnections") + private List workloadExpressRouteConnections; + + /** Creates an instance of NetworkFabricControllerProperties class. */ + public NetworkFabricControllerProperties() { + } + + /** + * Get the infrastructureServices property: InfrastructureServices IP ranges. + * + * @return the infrastructureServices value. + */ + public NetworkFabricControllerPropertiesInfrastructureServices infrastructureServices() { + return this.infrastructureServices; + } + + /** + * Get the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + public NetworkFabricControllerPropertiesWorkloadServices workloadServices() { + return this.workloadServices; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the NetworkFabricControllerProperties object itself. + */ + public NetworkFabricControllerProperties withManagedResourceGroupConfiguration( + NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the networkFabricIds property: The NF-ID will be an input parameter used by the NF to link and get associated + * with the parent NFC Service. + * + * @return the networkFabricIds value. + */ + public List networkFabricIds() { + return this.networkFabricIds; + } + + /** + * Get the workloadManagementNetwork property: A workload management network is required for all the tenant + * (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or + * any other MSFT/Public endpoints. + * + * @return the workloadManagementNetwork value. + */ + public Boolean workloadManagementNetwork() { + return this.workloadManagementNetwork; + } + + /** + * Get the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space. + * + * @return the ipv4AddressSpace value. + */ + public String ipv4AddressSpace() { + return this.ipv4AddressSpace; + } + + /** + * Set the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space. + * + * @param ipv4AddressSpace the ipv4AddressSpace value to set. + * @return the NetworkFabricControllerProperties object itself. + */ + public NetworkFabricControllerProperties withIpv4AddressSpace(String ipv4AddressSpace) { + this.ipv4AddressSpace = ipv4AddressSpace; + return this; + } + + /** + * Get the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space. + * + * @return the ipv6AddressSpace value. + */ + public String ipv6AddressSpace() { + return this.ipv6AddressSpace; + } + + /** + * Set the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space. + * + * @param ipv6AddressSpace the ipv6AddressSpace value to set. + * @return the NetworkFabricControllerProperties object itself. + */ + public NetworkFabricControllerProperties withIpv6AddressSpace(String ipv6AddressSpace) { + this.ipv6AddressSpace = ipv6AddressSpace; + return this; + } + + /** + * Get the operationalState property: The Operational Status would always be NULL. Look only in to the Provisioning + * state for the latest status. + * + * @return the operationalState value. + */ + public NetworkFabricControllerOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get the provisioningState property: Provides you the latest status of the NFC service, whether it is Accepted, + * updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC + * provisioning. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @return the infrastructureExpressRouteConnections value. + */ + public List infrastructureExpressRouteConnections() { + return this.infrastructureExpressRouteConnections; + } + + /** + * Set the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections the infrastructureExpressRouteConnections value to set. + * @return the NetworkFabricControllerProperties object itself. + */ + public NetworkFabricControllerProperties withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections) { + this.infrastructureExpressRouteConnections = infrastructureExpressRouteConnections; + return this; + } + + /** + * Get the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @return the workloadExpressRouteConnections value. + */ + public List workloadExpressRouteConnections() { + return this.workloadExpressRouteConnections; + } + + /** + * Set the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @param workloadExpressRouteConnections the workloadExpressRouteConnections value to set. + * @return the NetworkFabricControllerProperties object itself. + */ + public NetworkFabricControllerProperties withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections) { + this.workloadExpressRouteConnections = workloadExpressRouteConnections; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricControllerProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (infrastructureServices() != null) { + infrastructureServices().validate(); + } + if (workloadServices() != null) { + workloadServices().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (infrastructureExpressRouteConnections() != null) { + infrastructureExpressRouteConnections().forEach(e -> e.validate()); + } + if (workloadExpressRouteConnections() != null) { + workloadExpressRouteConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java new file mode 100644 index 000000000000..d4ff187208e7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesTerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The NetworkFabric resource definition. */ +@Fluent +public final class NetworkFabricInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private NetworkFabricProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkFabricInner class. */ + public NetworkFabricInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkFabricProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user + * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it + * is a single / multi rack Network Fabric. + * + * @return the networkFabricSku value. + */ + public String networkFabricSku() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricSku(); + } + + /** + * Set the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user + * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it + * is a single / multi rack Network Fabric. + * + * @param networkFabricSku the networkFabricSku value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withNetworkFabricSku(String networkFabricSku) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withNetworkFabricSku(networkFabricSku); + return this; + } + + /** + * Get the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8. + * + * @return the rackCount value. + */ + public Integer rackCount() { + return this.innerProperties() == null ? null : this.innerProperties().rackCount(); + } + + /** + * Set the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8. + * + * @param rackCount the rackCount value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withRackCount(Integer rackCount) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withRackCount(rackCount); + return this; + } + + /** + * Get the serverCountPerRack property: Number of servers.Possible values are from 1-16. + * + * @return the serverCountPerRack value. + */ + public Integer serverCountPerRack() { + return this.innerProperties() == null ? null : this.innerProperties().serverCountPerRack(); + } + + /** + * Set the serverCountPerRack property: Number of servers.Possible values are from 1-16. + * + * @param serverCountPerRack the serverCountPerRack value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withServerCountPerRack(Integer serverCountPerRack) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withServerCountPerRack(serverCountPerRack); + return this; + } + + /** + * Get the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * + * @return the ipv4Prefix value. + */ + public String ipv4Prefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv4Prefix(); + } + + /** + * Set the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * + * @param ipv4Prefix the ipv4Prefix value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withIpv4Prefix(String ipv4Prefix) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withIpv4Prefix(ipv4Prefix); + return this; + } + + /** + * Get the ipv6Prefix property: IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * + * @return the ipv6Prefix value. + */ + public String ipv6Prefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6Prefix(); + } + + /** + * Set the ipv6Prefix property: IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * + * @param ipv6Prefix the ipv6Prefix value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withIpv6Prefix(String ipv6Prefix) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withIpv6Prefix(ipv6Prefix); + return this; + } + + /** + * Get the routerId property: Router Id of CE to be used for MP-BGP between PE and CE. + * + * @return the routerId value. + */ + public String routerId() { + return this.innerProperties() == null ? null : this.innerProperties().routerId(); + } + + /** + * Get the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @return the fabricAsn value. + */ + public Integer fabricAsn() { + return this.innerProperties() == null ? null : this.innerProperties().fabricAsn(); + } + + /** + * Set the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @param fabricAsn the fabricAsn value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withFabricAsn(Integer fabricAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withFabricAsn(fabricAsn); + return this; + } + + /** + * Get the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * + * @return the networkFabricControllerId value. + */ + public String networkFabricControllerId() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricControllerId(); + } + + /** + * Set the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * + * @param networkFabricControllerId the networkFabricControllerId value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withNetworkFabricControllerId(String networkFabricControllerId) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withNetworkFabricControllerId(networkFabricControllerId); + return this; + } + + /** + * Get the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal + * server. + * + * @return the terminalServerConfiguration value. + */ + public NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().terminalServerConfiguration(); + } + + /** + * Set the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal + * server. + * + * @param terminalServerConfiguration the terminalServerConfiguration value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withTerminalServerConfiguration( + NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withTerminalServerConfiguration(terminalServerConfiguration); + return this; + } + + /** + * Get the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @return the managementNetworkConfiguration value. + */ + public NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managementNetworkConfiguration(); + } + + /** + * Set the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @param managementNetworkConfiguration the managementNetworkConfiguration value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withManagementNetworkConfiguration( + NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withManagementNetworkConfiguration(managementNetworkConfiguration); + return this; + } + + /** + * Get the operationalState property: Gets the operational state of the resource. + * + * @return the operationalState value. + */ + public NetworkFabricOperationalState operationalState() { + return this.innerProperties() == null ? null : this.innerProperties().operationalState(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + public List racks() { + return this.innerProperties() == null ? null : this.innerProperties().racks(); + } + + /** + * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + public List l2IsolationDomains() { + return this.innerProperties() == null ? null : this.innerProperties().l2IsolationDomains(); + } + + /** + * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + public List l3IsolationDomains() { + return this.innerProperties() == null ? null : this.innerProperties().l3IsolationDomains(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkFabricInner object itself. + */ + public NetworkFabricInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricPatchParametersProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricPatchParametersProperties.java new file mode 100644 index 000000000000..87019f432553 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricPatchParametersProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchParametersTerminalServerConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Fabric Patch properties. */ +@Fluent +public final class NetworkFabricPatchParametersProperties extends AnnotationResource { + /* + * Network and credentials configuration already applied to terminal server. + */ + @JsonProperty(value = "terminalServerConfiguration") + private TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration; + + /* + * List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network + * Fabric SKU. + */ + @JsonProperty(value = "racks", access = JsonProperty.Access.WRITE_ONLY) + private List racks; + + /* + * List of L2IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l2IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l2IsolationDomains; + + /* + * List of L3IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l3IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l3IsolationDomains; + + /** Creates an instance of NetworkFabricPatchParametersProperties class. */ + public NetworkFabricPatchParametersProperties() { + } + + /** + * Get the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @return the terminalServerConfiguration value. + */ + public TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration() { + return this.terminalServerConfiguration; + } + + /** + * Set the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @param terminalServerConfiguration the terminalServerConfiguration value to set. + * @return the NetworkFabricPatchParametersProperties object itself. + */ + public NetworkFabricPatchParametersProperties withTerminalServerConfiguration( + TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration) { + this.terminalServerConfiguration = terminalServerConfiguration; + return this; + } + + /** + * Get the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + public List racks() { + return this.racks; + } + + /** + * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + public List l2IsolationDomains() { + return this.l2IsolationDomains; + } + + /** + * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + public List l3IsolationDomains() { + return this.l3IsolationDomains; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricPatchParametersProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (terminalServerConfiguration() != null) { + terminalServerConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java new file mode 100644 index 000000000000..4296d6147941 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesTerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkFabricProperties - define the resource properties. */ +@Fluent +public final class NetworkFabricProperties extends AnnotationResource { + /* + * Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user chooses a particular SKU, only + * supported racks can be added to the Network Fabric. The SKU determines whether it is a single / multi rack + * Network Fabric. + */ + @JsonProperty(value = "networkFabricSku", required = true) + private String networkFabricSku; + + /* + * Number of racks associated to Network Fabric.Possible values are from 2-8. + */ + @JsonProperty(value = "rackCount", required = true) + private int rackCount; + + /* + * Number of servers.Possible values are from 1-16. + */ + @JsonProperty(value = "serverCountPerRack", required = true) + private int serverCountPerRack; + + /* + * IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + */ + @JsonProperty(value = "ipv4Prefix") + private String ipv4Prefix; + + /* + * IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + */ + @JsonProperty(value = "ipv6Prefix") + private String ipv6Prefix; + + /* + * Router Id of CE to be used for MP-BGP between PE and CE + */ + @JsonProperty(value = "routerId", access = JsonProperty.Access.WRITE_ONLY) + private String routerId; + + /* + * ASN of CE devices for CE/PE connectivity. + */ + @JsonProperty(value = "fabricASN", required = true) + private int fabricAsn; + + /* + * Azure resource ID for the NetworkFabricController the NetworkFabric belongs. + */ + @JsonProperty(value = "networkFabricControllerId", required = true) + private String networkFabricControllerId; + + /* + * Network and credentials configuration currently applied to terminal server. + */ + @JsonProperty(value = "terminalServerConfiguration", required = true) + private NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration; + + /* + * Configuration to be used to setup the management network. + */ + @JsonProperty(value = "managementNetworkConfiguration", required = true) + private NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration; + + /* + * Gets the operational state of the resource. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private NetworkFabricOperationalState operationalState; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network + * Fabric SKU. + */ + @JsonProperty(value = "racks", access = JsonProperty.Access.WRITE_ONLY) + private List racks; + + /* + * List of L2IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l2IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l2IsolationDomains; + + /* + * List of L3IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l3IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l3IsolationDomains; + + /** Creates an instance of NetworkFabricProperties class. */ + public NetworkFabricProperties() { + } + + /** + * Get the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user + * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it + * is a single / multi rack Network Fabric. + * + * @return the networkFabricSku value. + */ + public String networkFabricSku() { + return this.networkFabricSku; + } + + /** + * Set the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user + * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it + * is a single / multi rack Network Fabric. + * + * @param networkFabricSku the networkFabricSku value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withNetworkFabricSku(String networkFabricSku) { + this.networkFabricSku = networkFabricSku; + return this; + } + + /** + * Get the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8. + * + * @return the rackCount value. + */ + public int rackCount() { + return this.rackCount; + } + + /** + * Set the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8. + * + * @param rackCount the rackCount value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withRackCount(int rackCount) { + this.rackCount = rackCount; + return this; + } + + /** + * Get the serverCountPerRack property: Number of servers.Possible values are from 1-16. + * + * @return the serverCountPerRack value. + */ + public int serverCountPerRack() { + return this.serverCountPerRack; + } + + /** + * Set the serverCountPerRack property: Number of servers.Possible values are from 1-16. + * + * @param serverCountPerRack the serverCountPerRack value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withServerCountPerRack(int serverCountPerRack) { + this.serverCountPerRack = serverCountPerRack; + return this; + } + + /** + * Get the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * + * @return the ipv4Prefix value. + */ + public String ipv4Prefix() { + return this.ipv4Prefix; + } + + /** + * Set the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * + * @param ipv4Prefix the ipv4Prefix value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withIpv4Prefix(String ipv4Prefix) { + this.ipv4Prefix = ipv4Prefix; + return this; + } + + /** + * Get the ipv6Prefix property: IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * + * @return the ipv6Prefix value. + */ + public String ipv6Prefix() { + return this.ipv6Prefix; + } + + /** + * Set the ipv6Prefix property: IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * + * @param ipv6Prefix the ipv6Prefix value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withIpv6Prefix(String ipv6Prefix) { + this.ipv6Prefix = ipv6Prefix; + return this; + } + + /** + * Get the routerId property: Router Id of CE to be used for MP-BGP between PE and CE. + * + * @return the routerId value. + */ + public String routerId() { + return this.routerId; + } + + /** + * Get the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @return the fabricAsn value. + */ + public int fabricAsn() { + return this.fabricAsn; + } + + /** + * Set the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @param fabricAsn the fabricAsn value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withFabricAsn(int fabricAsn) { + this.fabricAsn = fabricAsn; + return this; + } + + /** + * Get the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * + * @return the networkFabricControllerId value. + */ + public String networkFabricControllerId() { + return this.networkFabricControllerId; + } + + /** + * Set the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * + * @param networkFabricControllerId the networkFabricControllerId value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withNetworkFabricControllerId(String networkFabricControllerId) { + this.networkFabricControllerId = networkFabricControllerId; + return this; + } + + /** + * Get the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal + * server. + * + * @return the terminalServerConfiguration value. + */ + public NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration() { + return this.terminalServerConfiguration; + } + + /** + * Set the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal + * server. + * + * @param terminalServerConfiguration the terminalServerConfiguration value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withTerminalServerConfiguration( + NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration) { + this.terminalServerConfiguration = terminalServerConfiguration; + return this; + } + + /** + * Get the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @return the managementNetworkConfiguration value. + */ + public NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration() { + return this.managementNetworkConfiguration; + } + + /** + * Set the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @param managementNetworkConfiguration the managementNetworkConfiguration value to set. + * @return the NetworkFabricProperties object itself. + */ + public NetworkFabricProperties withManagementNetworkConfiguration( + NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration) { + this.managementNetworkConfiguration = managementNetworkConfiguration; + return this; + } + + /** + * Get the operationalState property: Gets the operational state of the resource. + * + * @return the operationalState value. + */ + public NetworkFabricOperationalState operationalState() { + return this.operationalState; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + public List racks() { + return this.racks; + } + + /** + * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + public List l2IsolationDomains() { + return this.l2IsolationDomains; + } + + /** + * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + public List l3IsolationDomains() { + return this.l3IsolationDomains; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkFabricSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricSku in model NetworkFabricProperties")); + } + if (networkFabricControllerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricControllerId in model NetworkFabricProperties")); + } + if (terminalServerConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property terminalServerConfiguration in model NetworkFabricProperties")); + } else { + terminalServerConfiguration().validate(); + } + if (managementNetworkConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managementNetworkConfiguration in model NetworkFabricProperties")); + } else { + managementNetworkConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkFabricProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java new file mode 100644 index 000000000000..c08fce376e9a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkFabricSku resource definition. */ +@Fluent +public final class NetworkFabricSkuInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private NetworkFabricSkuProperties innerProperties = new NetworkFabricSkuProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkFabricSkuInner class. */ + public NetworkFabricSkuInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkFabricSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: Type of Network Fabric Sku. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the maxComputeRacks property: Maximum number of compute racks available for this Network Fabric SKU. + * + * @return the maxComputeRacks value. + */ + public Integer maxComputeRacks() { + return this.innerProperties() == null ? null : this.innerProperties().maxComputeRacks(); + } + + /** + * Set the maxComputeRacks property: Maximum number of compute racks available for this Network Fabric SKU. + * + * @param maxComputeRacks the maxComputeRacks value to set. + * @return the NetworkFabricSkuInner object itself. + */ + public NetworkFabricSkuInner withMaxComputeRacks(Integer maxComputeRacks) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricSkuProperties(); + } + this.innerProperties().withMaxComputeRacks(maxComputeRacks); + return this; + } + + /** + * Get the minSupportedVer property: Minimum supported version. + * + * @return the minSupportedVer value. + */ + public String minSupportedVer() { + return this.innerProperties() == null ? null : this.innerProperties().minSupportedVer(); + } + + /** + * Get the maxSupportedVer property: Maximum supported version. + * + * @return the maxSupportedVer value. + */ + public String maxSupportedVer() { + return this.innerProperties() == null ? null : this.innerProperties().maxSupportedVer(); + } + + /** + * Get the detailsUri property: The URI gives full details of sku. + * + * @return the detailsUri value. + */ + public String detailsUri() { + return this.innerProperties() == null ? null : this.innerProperties().detailsUri(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * 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 NetworkFabricSkuInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkFabricSkuInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuProperties.java new file mode 100644 index 000000000000..e7eb14029de3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NetworkFabricSkuProperties define the resource properties. */ +@Fluent +public final class NetworkFabricSkuProperties { + /* + * Type of Network Fabric Sku. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Maximum number of compute racks available for this Network Fabric SKU. + */ + @JsonProperty(value = "maxComputeRacks") + private Integer maxComputeRacks; + + /* + * Minimum supported version. + */ + @JsonProperty(value = "minSupportedVer", access = JsonProperty.Access.WRITE_ONLY) + private String minSupportedVer; + + /* + * Maximum supported version. + */ + @JsonProperty(value = "maxSupportedVer", access = JsonProperty.Access.WRITE_ONLY) + private String maxSupportedVer; + + /* + * The URI gives full details of sku. + */ + @JsonProperty(value = "detailsUri", access = JsonProperty.Access.WRITE_ONLY) + private String detailsUri; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of NetworkFabricSkuProperties class. */ + public NetworkFabricSkuProperties() { + } + + /** + * Get the type property: Type of Network Fabric Sku. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the maxComputeRacks property: Maximum number of compute racks available for this Network Fabric SKU. + * + * @return the maxComputeRacks value. + */ + public Integer maxComputeRacks() { + return this.maxComputeRacks; + } + + /** + * Set the maxComputeRacks property: Maximum number of compute racks available for this Network Fabric SKU. + * + * @param maxComputeRacks the maxComputeRacks value to set. + * @return the NetworkFabricSkuProperties object itself. + */ + public NetworkFabricSkuProperties withMaxComputeRacks(Integer maxComputeRacks) { + this.maxComputeRacks = maxComputeRacks; + return this; + } + + /** + * Get the minSupportedVer property: Minimum supported version. + * + * @return the minSupportedVer value. + */ + public String minSupportedVer() { + return this.minSupportedVer; + } + + /** + * Get the maxSupportedVer property: Maximum supported version. + * + * @return the maxSupportedVer value. + */ + public String maxSupportedVer() { + return this.maxSupportedVer; + } + + /** + * Get the detailsUri property: The URI gives full details of sku. + * + * @return the detailsUri value. + */ + public String detailsUri() { + return this.detailsUri; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java new file mode 100644 index 000000000000..ae23193f6106 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceType; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the NetworkInterface resource. */ +@Fluent +public final class NetworkInterfaceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private NetworkInterfaceProperties innerProperties = new NetworkInterfaceProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkInterfaceInner class. */ + public NetworkInterfaceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkInterfaceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the physicalIdentifier property: physicalIdentifier of the network interface. + * + * @return the physicalIdentifier value. + */ + public String physicalIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().physicalIdentifier(); + } + + /** + * Get the administrativeState property: administrativeState of the network interface. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the connectedTo property: The arm resource id of the interface or compute server its connected to. + * + * @return the connectedTo value. + */ + public String connectedTo() { + return this.innerProperties() == null ? null : this.innerProperties().connectedTo(); + } + + /** + * Get the interfaceType property: The Interface Type. Example: Management/Data. + * + * @return the interfaceType value. + */ + public InterfaceType interfaceType() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceType(); + } + + /** + * Get the ipv4Address property: ipv4Address. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.innerProperties() == null ? null : this.innerProperties().ipv4Address(); + } + + /** + * Get the ipv6Address property: ipv6Address. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6Address(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 NetworkInterfaceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkInterfaceInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfacePatchProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfacePatchProperties.java new file mode 100644 index 000000000000..2f6ae67f3ed7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfacePatchProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; + +/** Network Interface Patch properties. */ +@Fluent +public final class NetworkInterfacePatchProperties extends AnnotationResource { + /** Creates an instance of NetworkInterfacePatchProperties class. */ + public NetworkInterfacePatchProperties() { + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfacePatchProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceProperties.java new file mode 100644 index 000000000000..eeb1c5ecc2a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceType; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NetworkInterfaceProperties define the resource properties. */ +@Fluent +public final class NetworkInterfaceProperties extends AnnotationResource { + /* + * physicalIdentifier of the network interface. + */ + @JsonProperty(value = "physicalIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String physicalIdentifier; + + /* + * administrativeState of the network interface. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The arm resource id of the interface or compute server its connected to. + */ + @JsonProperty(value = "connectedTo", access = JsonProperty.Access.WRITE_ONLY) + private String connectedTo; + + /* + * The Interface Type. Example: Management/Data + */ + @JsonProperty(value = "interfaceType", access = JsonProperty.Access.WRITE_ONLY) + private InterfaceType interfaceType; + + /* + * ipv4Address. + */ + @JsonProperty(value = "ipv4Address", access = JsonProperty.Access.WRITE_ONLY) + private String ipv4Address; + + /* + * ipv6Address. + */ + @JsonProperty(value = "ipv6Address", access = JsonProperty.Access.WRITE_ONLY) + private String ipv6Address; + + /** Creates an instance of NetworkInterfaceProperties class. */ + public NetworkInterfaceProperties() { + } + + /** + * Get the physicalIdentifier property: physicalIdentifier of the network interface. + * + * @return the physicalIdentifier value. + */ + public String physicalIdentifier() { + return this.physicalIdentifier; + } + + /** + * Get the administrativeState property: administrativeState of the network interface. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the connectedTo property: The arm resource id of the interface or compute server its connected to. + * + * @return the connectedTo value. + */ + public String connectedTo() { + return this.connectedTo; + } + + /** + * Get the interfaceType property: The Interface Type. Example: Management/Data. + * + * @return the interfaceType value. + */ + public InterfaceType interfaceType() { + return this.interfaceType; + } + + /** + * Get the ipv4Address property: ipv4Address. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Get the ipv6Address property: ipv6Address. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** {@inheritDoc} */ + @Override + public NetworkInterfaceProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackInner.java new file mode 100644 index 000000000000..474a09dcf33c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackInner.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The NetworkRack resource definition. */ +@Fluent +public final class NetworkRackInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private NetworkRackProperties innerProperties = new NetworkRackProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkRackInner class. */ + public NetworkRackInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkRackProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NetworkRackInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRackInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the networkRackSku property: Network Rack SKU name. + * + * @return the networkRackSku value. + */ + public String networkRackSku() { + return this.innerProperties() == null ? null : this.innerProperties().networkRackSku(); + } + + /** + * Set the networkRackSku property: Network Rack SKU name. + * + * @param networkRackSku the networkRackSku value to set. + * @return the NetworkRackInner object itself. + */ + public NetworkRackInner withNetworkRackSku(String networkRackSku) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackProperties(); + } + this.innerProperties().withNetworkRackSku(networkRackSku); + return this; + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricId(); + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the NetworkRackInner object itself. + */ + public NetworkRackInner withNetworkFabricId(String networkFabricId) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackProperties(); + } + this.innerProperties().withNetworkFabricId(networkFabricId); + return this; + } + + /** + * Get the networkDevices property: List of network device ARM resource ids. + * + * @return the networkDevices value. + */ + public List networkDevices() { + return this.innerProperties() == null ? null : this.innerProperties().networkDevices(); + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkRackInner object itself. + */ + public NetworkRackInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 NetworkRackInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRackInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackProperties.java new file mode 100644 index 000000000000..d7fb339fb4c0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkRackProperties define the resource properties. */ +@Fluent +public final class NetworkRackProperties extends AnnotationResource { + /* + * Network Rack SKU name. + */ + @JsonProperty(value = "networkRackSku", required = true) + private String networkRackSku; + + /* + * Network Fabric ARM resource id. + */ + @JsonProperty(value = "networkFabricId", required = true) + private String networkFabricId; + + /* + * List of network device ARM resource ids. + */ + @JsonProperty(value = "networkDevices", access = JsonProperty.Access.WRITE_ONLY) + private List networkDevices; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of NetworkRackProperties class. */ + public NetworkRackProperties() { + } + + /** + * Get the networkRackSku property: Network Rack SKU name. + * + * @return the networkRackSku value. + */ + public String networkRackSku() { + return this.networkRackSku; + } + + /** + * Set the networkRackSku property: Network Rack SKU name. + * + * @param networkRackSku the networkRackSku value to set. + * @return the NetworkRackProperties object itself. + */ + public NetworkRackProperties withNetworkRackSku(String networkRackSku) { + this.networkRackSku = networkRackSku; + return this; + } + + /** + * Get the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.networkFabricId; + } + + /** + * Set the networkFabricId property: Network Fabric ARM resource id. + * + * @param networkFabricId the networkFabricId value to set. + * @return the NetworkRackProperties object itself. + */ + public NetworkRackProperties withNetworkFabricId(String networkFabricId) { + this.networkFabricId = networkFabricId; + return this; + } + + /** + * Get the networkDevices property: List of network device ARM resource ids. + * + * @return the networkDevices value. + */ + public List networkDevices() { + return this.networkDevices; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public NetworkRackProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkRackSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkRackSku in model NetworkRackProperties")); + } + if (networkFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricId in model NetworkRackProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRackProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuInner.java new file mode 100644 index 000000000000..00673f71be0f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuInner.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkuPropertiesNetworkDevicesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NetworkRackSku resource definition. */ +@Fluent +public final class NetworkRackSkuInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private NetworkRackSkuProperties innerProperties = new NetworkRackSkuProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkRackSkuInner class. */ + public NetworkRackSkuInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkRackSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the roleName property: The role of the Network Rack: Aggregate or Compute. + * + * @return the roleName value. + */ + public NetworkRackRoleName roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: The role of the Network Rack: Aggregate or Compute. + * + * @param roleName the roleName value to set. + * @return the NetworkRackSkuInner object itself. + */ + public NetworkRackSkuInner withRoleName(NetworkRackRoleName roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackSkuProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the maximumServerCount property: Maximum number of servers available for this SKU. + * + * @return the maximumServerCount value. + */ + public Integer maximumServerCount() { + return this.innerProperties() == null ? null : this.innerProperties().maximumServerCount(); + } + + /** + * Set the maximumServerCount property: Maximum number of servers available for this SKU. + * + * @param maximumServerCount the maximumServerCount value to set. + * @return the NetworkRackSkuInner object itself. + */ + public NetworkRackSkuInner withMaximumServerCount(Integer maximumServerCount) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackSkuProperties(); + } + this.innerProperties().withMaximumServerCount(maximumServerCount); + return this; + } + + /** + * Get the maximumStorageCount property: Maximum number of storage devices available for this SKU. + * + * @return the maximumStorageCount value. + */ + public Integer maximumStorageCount() { + return this.innerProperties() == null ? null : this.innerProperties().maximumStorageCount(); + } + + /** + * Set the maximumStorageCount property: Maximum number of storage devices available for this SKU. + * + * @param maximumStorageCount the maximumStorageCount value to set. + * @return the NetworkRackSkuInner object itself. + */ + public NetworkRackSkuInner withMaximumStorageCount(Integer maximumStorageCount) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackSkuProperties(); + } + this.innerProperties().withMaximumStorageCount(maximumStorageCount); + return this; + } + + /** + * Get the maximumUplinks property: Maximum number of network uplinks available for this SKU. + * + * @return the maximumUplinks value. + */ + public Integer maximumUplinks() { + return this.innerProperties() == null ? null : this.innerProperties().maximumUplinks(); + } + + /** + * Set the maximumUplinks property: Maximum number of network uplinks available for this SKU. + * + * @param maximumUplinks the maximumUplinks value to set. + * @return the NetworkRackSkuInner object itself. + */ + public NetworkRackSkuInner withMaximumUplinks(Integer maximumUplinks) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackSkuProperties(); + } + this.innerProperties().withMaximumUplinks(maximumUplinks); + return this; + } + + /** + * Get the networkDevices property: List of network device properties / role for the Network Rack. + * + * @return the networkDevices value. + */ + public List networkDevices() { + return this.innerProperties() == null ? null : this.innerProperties().networkDevices(); + } + + /** + * Set the networkDevices property: List of network device properties / role for the Network Rack. + * + * @param networkDevices the networkDevices value to set. + * @return the NetworkRackSkuInner object itself. + */ + public NetworkRackSkuInner withNetworkDevices(List networkDevices) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRackSkuProperties(); + } + this.innerProperties().withNetworkDevices(networkDevices); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * 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 NetworkRackSkuInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRackSkuInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuProperties.java new file mode 100644 index 000000000000..405ff2747efe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuProperties.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkuPropertiesNetworkDevicesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkRackSkuProperties define the resource properties. */ +@Fluent +public final class NetworkRackSkuProperties { + /* + * The role of the Network Rack: Aggregate or Compute. + */ + @JsonProperty(value = "roleName", required = true) + private NetworkRackRoleName roleName; + + /* + * Maximum number of servers available for this SKU. + */ + @JsonProperty(value = "maximumServerCount") + private Integer maximumServerCount; + + /* + * Maximum number of storage devices available for this SKU. + */ + @JsonProperty(value = "maximumStorageCount") + private Integer maximumStorageCount; + + /* + * Maximum number of network uplinks available for this SKU. + */ + @JsonProperty(value = "maximumUplinks") + private Integer maximumUplinks; + + /* + * List of network device properties / role for the Network Rack. + */ + @JsonProperty(value = "networkDevices") + private List networkDevices; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of NetworkRackSkuProperties class. */ + public NetworkRackSkuProperties() { + } + + /** + * Get the roleName property: The role of the Network Rack: Aggregate or Compute. + * + * @return the roleName value. + */ + public NetworkRackRoleName roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The role of the Network Rack: Aggregate or Compute. + * + * @param roleName the roleName value to set. + * @return the NetworkRackSkuProperties object itself. + */ + public NetworkRackSkuProperties withRoleName(NetworkRackRoleName roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the maximumServerCount property: Maximum number of servers available for this SKU. + * + * @return the maximumServerCount value. + */ + public Integer maximumServerCount() { + return this.maximumServerCount; + } + + /** + * Set the maximumServerCount property: Maximum number of servers available for this SKU. + * + * @param maximumServerCount the maximumServerCount value to set. + * @return the NetworkRackSkuProperties object itself. + */ + public NetworkRackSkuProperties withMaximumServerCount(Integer maximumServerCount) { + this.maximumServerCount = maximumServerCount; + return this; + } + + /** + * Get the maximumStorageCount property: Maximum number of storage devices available for this SKU. + * + * @return the maximumStorageCount value. + */ + public Integer maximumStorageCount() { + return this.maximumStorageCount; + } + + /** + * Set the maximumStorageCount property: Maximum number of storage devices available for this SKU. + * + * @param maximumStorageCount the maximumStorageCount value to set. + * @return the NetworkRackSkuProperties object itself. + */ + public NetworkRackSkuProperties withMaximumStorageCount(Integer maximumStorageCount) { + this.maximumStorageCount = maximumStorageCount; + return this; + } + + /** + * Get the maximumUplinks property: Maximum number of network uplinks available for this SKU. + * + * @return the maximumUplinks value. + */ + public Integer maximumUplinks() { + return this.maximumUplinks; + } + + /** + * Set the maximumUplinks property: Maximum number of network uplinks available for this SKU. + * + * @param maximumUplinks the maximumUplinks value to set. + * @return the NetworkRackSkuProperties object itself. + */ + public NetworkRackSkuProperties withMaximumUplinks(Integer maximumUplinks) { + this.maximumUplinks = maximumUplinks; + return this; + } + + /** + * Get the networkDevices property: List of network device properties / role for the Network Rack. + * + * @return the networkDevices value. + */ + public List networkDevices() { + return this.networkDevices; + } + + /** + * Set the networkDevices property: List of network device properties / role for the Network Rack. + * + * @param networkDevices the networkDevices value to set. + * @return the NetworkRackSkuProperties object itself. + */ + public NetworkRackSkuProperties withNetworkDevices( + List networkDevices) { + this.networkDevices = networkDevices; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleName in model NetworkRackSkuProperties")); + } + if (networkDevices() != null) { + networkDevices().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRackSkuProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java new file mode 100644 index 000000000000..1973576daad4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesLayer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkToNetworkInterconnect resource definition. */ +@Fluent +public final class NetworkToNetworkInterconnectInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private NetworkToNetworkInterconnectProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of NetworkToNetworkInterconnectInner class. */ + public NetworkToNetworkInterconnectInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private NetworkToNetworkInterconnectProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the administrativeState property: Gets the administrativeState of the resource. Example -Enabled/Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.innerProperties() == null ? null : this.innerProperties().administrativeState(); + } + + /** + * Get the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: True/False. + * + * @return the isManagementType value. + */ + public BooleanEnumProperty isManagementType() { + return this.innerProperties() == null ? null : this.innerProperties().isManagementType(); + } + + /** + * Set the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: True/False. + * + * @param isManagementType the isManagementType value to set. + * @return the NetworkToNetworkInterconnectInner object itself. + */ + public NetworkToNetworkInterconnectInner withIsManagementType(BooleanEnumProperty isManagementType) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkToNetworkInterconnectProperties(); + } + this.innerProperties().withIsManagementType(isManagementType); + return this; + } + + /** + * Get the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False. + * + * @return the useOptionB value. + */ + public BooleanEnumProperty useOptionB() { + return this.innerProperties() == null ? null : this.innerProperties().useOptionB(); + } + + /** + * Set the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False. + * + * @param useOptionB the useOptionB value to set. + * @return the NetworkToNetworkInterconnectInner object itself. + */ + public NetworkToNetworkInterconnectInner withUseOptionB(BooleanEnumProperty useOptionB) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkToNetworkInterconnectProperties(); + } + this.innerProperties().withUseOptionB(useOptionB); + return this; + } + + /** + * Get the layer2Configuration property: Common properties for Layer2Configuration. + * + * @return the layer2Configuration value. + */ + public NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration() { + return this.innerProperties() == null ? null : this.innerProperties().layer2Configuration(); + } + + /** + * Set the layer2Configuration property: Common properties for Layer2Configuration. + * + * @param layer2Configuration the layer2Configuration value to set. + * @return the NetworkToNetworkInterconnectInner object itself. + */ + public NetworkToNetworkInterconnectInner withLayer2Configuration( + NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkToNetworkInterconnectProperties(); + } + this.innerProperties().withLayer2Configuration(layer2Configuration); + return this; + } + + /** + * Get the layer3Configuration property: Common properties for Layer3Configuration. + * + * @return the layer3Configuration value. + */ + public Layer3Configuration layer3Configuration() { + return this.innerProperties() == null ? null : this.innerProperties().layer3Configuration(); + } + + /** + * Set the layer3Configuration property: Common properties for Layer3Configuration. + * + * @param layer3Configuration the layer3Configuration value to set. + * @return the NetworkToNetworkInterconnectInner object itself. + */ + public NetworkToNetworkInterconnectInner withLayer3Configuration(Layer3Configuration layer3Configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkToNetworkInterconnectProperties(); + } + this.innerProperties().withLayer3Configuration(layer3Configuration); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectProperties.java new file mode 100644 index 000000000000..1051772fd7a0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesLayer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration used to setup CE-PE connectivity. */ +@Fluent +public final class NetworkToNetworkInterconnectProperties { + /* + * Gets the administrativeState of the resource. Example -Enabled/Disabled + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Configuration to use NNI for Infrastructure Management. Example: True/False. + */ + @JsonProperty(value = "isManagementType", required = true) + private BooleanEnumProperty isManagementType; + + /* + * Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False + */ + @JsonProperty(value = "useOptionB", required = true) + private BooleanEnumProperty useOptionB; + + /* + * Common properties for Layer2Configuration. + */ + @JsonProperty(value = "layer2Configuration") + private NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration; + + /* + * Common properties for Layer3Configuration. + */ + @JsonProperty(value = "layer3Configuration") + private Layer3Configuration layer3Configuration; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of NetworkToNetworkInterconnectProperties class. */ + public NetworkToNetworkInterconnectProperties() { + } + + /** + * Get the administrativeState property: Gets the administrativeState of the resource. Example -Enabled/Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: True/False. + * + * @return the isManagementType value. + */ + public BooleanEnumProperty isManagementType() { + return this.isManagementType; + } + + /** + * Set the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: True/False. + * + * @param isManagementType the isManagementType value to set. + * @return the NetworkToNetworkInterconnectProperties object itself. + */ + public NetworkToNetworkInterconnectProperties withIsManagementType(BooleanEnumProperty isManagementType) { + this.isManagementType = isManagementType; + return this; + } + + /** + * Get the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False. + * + * @return the useOptionB value. + */ + public BooleanEnumProperty useOptionB() { + return this.useOptionB; + } + + /** + * Set the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False. + * + * @param useOptionB the useOptionB value to set. + * @return the NetworkToNetworkInterconnectProperties object itself. + */ + public NetworkToNetworkInterconnectProperties withUseOptionB(BooleanEnumProperty useOptionB) { + this.useOptionB = useOptionB; + return this; + } + + /** + * Get the layer2Configuration property: Common properties for Layer2Configuration. + * + * @return the layer2Configuration value. + */ + public NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration() { + return this.layer2Configuration; + } + + /** + * Set the layer2Configuration property: Common properties for Layer2Configuration. + * + * @param layer2Configuration the layer2Configuration value to set. + * @return the NetworkToNetworkInterconnectProperties object itself. + */ + public NetworkToNetworkInterconnectProperties withLayer2Configuration( + NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration) { + this.layer2Configuration = layer2Configuration; + return this; + } + + /** + * Get the layer3Configuration property: Common properties for Layer3Configuration. + * + * @return the layer3Configuration value. + */ + public Layer3Configuration layer3Configuration() { + return this.layer3Configuration; + } + + /** + * Set the layer3Configuration property: Common properties for Layer3Configuration. + * + * @param layer3Configuration the layer3Configuration value to set. + * @return the NetworkToNetworkInterconnectProperties object itself. + */ + public NetworkToNetworkInterconnectProperties withLayer3Configuration(Layer3Configuration layer3Configuration) { + this.layer3Configuration = layer3Configuration; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (isManagementType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property isManagementType in model NetworkToNetworkInterconnectProperties")); + } + if (useOptionB() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property useOptionB in model NetworkToNetworkInterconnectProperties")); + } + if (layer2Configuration() != null) { + layer2Configuration().validate(); + } + if (layer3Configuration() != null) { + layer3Configuration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkToNetworkInterconnectProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/OperationInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/OperationInner.java new file mode 100644 index 000000000000..2b27416d88bb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.ActionType; +import com.azure.resourcemanager.managednetworkfabric.models.OperationDisplay; +import com.azure.resourcemanager.managednetworkfabric.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java new file mode 100644 index 000000000000..00daa89ebe57 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The RoutePolicy resource definition. */ +@Fluent +public final class RoutePolicyInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private RoutePolicyProperties innerProperties = new RoutePolicyProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RoutePolicyInner class. */ + public RoutePolicyInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private RoutePolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public RoutePolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutePolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: Route Policy description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Route Policy description. + * + * @param description the description value to set. + * @return the RoutePolicyInner object itself. + */ + public RoutePolicyInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the conditions property: Route Policy conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: Route Policy conditions. + * + * @param conditions the conditions value to set. + * @return the RoutePolicyInner object itself. + */ + public RoutePolicyInner withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyProperties(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the RoutePolicyInner object itself. + */ + public RoutePolicyInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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 RoutePolicyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutePolicyInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java new file mode 100644 index 000000000000..34e8e74ecca7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RoutePolicyProperties define the resource properties. */ +@Fluent +public final class RoutePolicyProperties extends AnnotationResource { + /* + * Route Policy description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Route Policy conditions. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of RoutePolicyProperties class. */ + public RoutePolicyProperties() { + } + + /** + * Get the description property: Route Policy description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Route Policy description. + * + * @param description the description value to set. + * @return the RoutePolicyProperties object itself. + */ + public RoutePolicyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the conditions property: Route Policy conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Route Policy conditions. + * + * @param conditions the conditions value to set. + * @return the RoutePolicyProperties object itself. + */ + public RoutePolicyProperties withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public RoutePolicyProperties withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/SupportPackagePropertiesInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/SupportPackagePropertiesInner.java new file mode 100644 index 000000000000..34e09bec9cdd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/SupportPackagePropertiesInner.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.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Generate support package post action properties. */ +@Fluent +public final class SupportPackagePropertiesInner { + /* + * The URL to fetch the generated support package from. + */ + @JsonProperty(value = "supportPackageURL", required = true) + private String supportPackageUrl; + + /** Creates an instance of SupportPackagePropertiesInner class. */ + public SupportPackagePropertiesInner() { + } + + /** + * Get the supportPackageUrl property: The URL to fetch the generated support package from. + * + * @return the supportPackageUrl value. + */ + public String supportPackageUrl() { + return this.supportPackageUrl; + } + + /** + * Set the supportPackageUrl property: The URL to fetch the generated support package from. + * + * @param supportPackageUrl the supportPackageUrl value to set. + * @return the SupportPackagePropertiesInner object itself. + */ + public SupportPackagePropertiesInner withSupportPackageUrl(String supportPackageUrl) { + this.supportPackageUrl = supportPackageUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportPackageUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property supportPackageUrl in model SupportPackagePropertiesInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SupportPackagePropertiesInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/package-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/package-info.java new file mode 100644 index 000000000000..9ca6456f2f39 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/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 inner data models for AzureNetworkFabricManagementServiceApi. Self service experience for + * Azure Network Fabric API. + */ +package com.azure.resourcemanager.managednetworkfabric.fluent.models; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/package-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/package-info.java new file mode 100644 index 000000000000..af1662da0f08 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/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 service clients for AzureNetworkFabricManagementServiceApi. Self service experience for Azure + * Network Fabric API. + */ +package com.azure.resourcemanager.managednetworkfabric.fluent; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java new file mode 100644 index 000000000000..a40b1ac3013f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AccessControlListImpl + implements AccessControlList, AccessControlList.Definition, AccessControlList.Update { + private AccessControlListInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AddressFamily addressFamily() { + return this.innerModel().addressFamily(); + } + + public List conditions() { + List inner = this.innerModel().conditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AccessControlListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accessControlListName; + + private AccessControlListPatch updateBody; + + public AccessControlListImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AccessControlList create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .createWithResponse(resourceGroupName, accessControlListName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AccessControlList create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .createWithResponse(resourceGroupName, accessControlListName, this.innerModel(), context) + .getValue(); + return this; + } + + AccessControlListImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new AccessControlListInner(); + this.serviceManager = serviceManager; + this.accessControlListName = name; + } + + public AccessControlListImpl update() { + this.updateBody = new AccessControlListPatch(); + return this; + } + + public AccessControlList apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .updateWithResponse(resourceGroupName, accessControlListName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public AccessControlList apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .updateWithResponse(resourceGroupName, accessControlListName, updateBody, context) + .getValue(); + return this; + } + + AccessControlListImpl( + AccessControlListInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accessControlListName = Utils.getValueFromIdByName(innerObject.id(), "accessControlLists"); + } + + public AccessControlList refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .getByResourceGroupWithResponse(resourceGroupName, accessControlListName, Context.NONE) + .getValue(); + return this; + } + + public AccessControlList refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessControlLists() + .getByResourceGroupWithResponse(resourceGroupName, accessControlListName, context) + .getValue(); + return this; + } + + public AccessControlListImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AccessControlListImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AccessControlListImpl withAddressFamily(AddressFamily addressFamily) { + if (isInCreateMode()) { + this.innerModel().withAddressFamily(addressFamily); + return this; + } else { + this.updateBody.withAddressFamily(addressFamily); + return this; + } + } + + public AccessControlListImpl withConditions(List conditions) { + this.innerModel().withConditions(conditions); + return this; + } + + public AccessControlListImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public AccessControlListImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + public AccessControlListImpl withConditionsForUpdate( + List conditions) { + this.updateBody.withConditions(conditions); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsClientImpl.java new file mode 100644 index 000000000000..ae0e69743b79 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsClientImpl.java @@ -0,0 +1,1301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.managednetworkfabric.fluent.AccessControlListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessControlListsClient. */ +public final class AccessControlListsClientImpl implements AccessControlListsClient { + /** The proxy service used to perform REST calls. */ + private final AccessControlListsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of AccessControlListsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessControlListsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(AccessControlListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiAccessControlLists to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface AccessControlListsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("accessControlListName") String accessControlListName, + @BodyParam("application/json") AccessControlListInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}") + @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("accessControlListName") String accessControlListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("accessControlListName") String accessControlListName, + @BodyParam("application/json") AccessControlListPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("accessControlListName") String accessControlListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/accessControlLists") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accessControlListName, AccessControlListInner body) { + 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accessControlListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accessControlListName, AccessControlListInner body, 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accessControlListName, + body, + accept, + context); + } + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accessControlListName, AccessControlListInner body) { + return createWithResponseAsync(resourceGroupName, accessControlListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String accessControlListName, AccessControlListInner body, Context context) { + return createWithResponseAsync(resourceGroupName, accessControlListName, body, context).block(); + } + + /** + * Create Access Control List. + * + *

Implements Access Control List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessControlListInner create( + String resourceGroupName, String accessControlListName, AccessControlListInner body) { + return createWithResponse(resourceGroupName, accessControlListName, body, Context.NONE).getValue(); + } + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accessControlListName) { + 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName 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(), + accessControlListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accessControlListName, 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName 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(), + accessControlListName, + accept, + context); + } + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String accessControlListName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accessControlListName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accessControlListName, context).block(); + } + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessControlListInner getByResourceGroup(String resourceGroupName, String accessControlListName) { + return getByResourceGroupWithResponse(resourceGroupName, accessControlListName, Context.NONE).getValue(); + } + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accessControlListName, AccessControlListPatch body) { + 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accessControlListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accessControlListName, AccessControlListPatch body, 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accessControlListName, + body, + accept, + context); + } + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accessControlListName, AccessControlListPatch body) { + return updateWithResponseAsync(resourceGroupName, accessControlListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accessControlListName, AccessControlListPatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, accessControlListName, body, context).block(); + } + + /** + * Updates a Access Control List. + * + *

API to update certain properties of the Access Control List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param body Access Control List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessControlListInner update( + String resourceGroupName, String accessControlListName, AccessControlListPatch body) { + return updateWithResponse(resourceGroupName, accessControlListName, body, Context.NONE).getValue(); + } + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 accessControlListName) { + 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName 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(), + accessControlListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 accessControlListName, 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 (accessControlListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter accessControlListName 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(), + accessControlListName, + accept, + context); + } + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accessControlListName) { + return deleteWithResponseAsync(resourceGroupName, accessControlListName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accessControlListName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accessControlListName, context).block(); + } + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 accessControlListName) { + deleteWithResponse(resourceGroupName, accessControlListName, Context.NONE); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists 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())); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists 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)); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists 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)); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @throws 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 AccessControlLists 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.getSubscriptionId(), + 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())); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 AccessControlLists 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @throws 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 AccessControlLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 AccessControlLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @throws 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 AccessControlLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 AccessControlLists 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 URL to get the next list of items + *

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 AccessControlLists 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 URL to get the next list of items + *

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 AccessControlLists 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 AccessControlLists 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 URL to get the next list of items + *

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 AccessControlLists 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsImpl.java new file mode 100644 index 000000000000..fad48d061504 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.AccessControlListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlLists; + +public final class AccessControlListsImpl implements AccessControlLists { + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListsImpl.class); + + private final AccessControlListsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public AccessControlListsImpl( + AccessControlListsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accessControlListName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessControlListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessControlList getByResourceGroup(String resourceGroupName, String accessControlListName) { + AccessControlListInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, accessControlListName); + if (inner != null) { + return new AccessControlListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accessControlListName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String accessControlListName) { + this.serviceClient().delete(resourceGroupName, accessControlListName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AccessControlListImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AccessControlListImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccessControlListImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AccessControlListImpl(inner1, this.manager())); + } + + public AccessControlList 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 accessControlListName = Utils.getValueFromIdByName(id, "accessControlLists"); + if (accessControlListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accessControlLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accessControlListName, 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 accessControlListName = Utils.getValueFromIdByName(id, "accessControlLists"); + if (accessControlListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accessControlLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accessControlListName, 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 accessControlListName = Utils.getValueFromIdByName(id, "accessControlLists"); + if (accessControlListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accessControlLists'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, accessControlListName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accessControlListName = Utils.getValueFromIdByName(id, "accessControlLists"); + if (accessControlListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'accessControlLists'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, accessControlListName, context); + } + + private AccessControlListsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public AccessControlListImpl define(String name) { + return new AccessControlListImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ArpPropertiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ArpPropertiesImpl.java new file mode 100644 index 000000000000..d306fbf923a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ArpPropertiesImpl.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.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ArpPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.ArpProperties; + +public final class ArpPropertiesImpl implements ArpProperties { + private ArpPropertiesInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + ArpPropertiesImpl( + ArpPropertiesInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String address() { + return this.innerModel().address(); + } + + public String age() { + return this.innerModel().age(); + } + + public String macAddress() { + return this.innerModel().macAddress(); + } + + public String interfaceProperty() { + return this.innerModel().interfaceProperty(); + } + + public String state() { + return this.innerModel().state(); + } + + public ArpPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java new file mode 100644 index 000000000000..c8c9d78d60a4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.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 AzureNetworkFabricManagementServiceApiImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureNetworkFabricManagementServiceApiImpl.class}) +public final class AzureNetworkFabricManagementServiceApiBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder 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 AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 AzureNetworkFabricManagementServiceApiBuilder. + */ + public AzureNetworkFabricManagementServiceApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureNetworkFabricManagementServiceApiImpl with the provided parameters. + * + * @return an instance of AzureNetworkFabricManagementServiceApiImpl. + */ + public AzureNetworkFabricManagementServiceApiImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AzureNetworkFabricManagementServiceApiImpl client = + new AzureNetworkFabricManagementServiceApiImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiImpl.java new file mode 100644 index 000000000000..8b5f6861ad3b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiImpl.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.CoreUtils; +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.managednetworkfabric.fluent.AccessControlListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.AzureNetworkFabricManagementServiceApi; +import com.azure.resourcemanager.managednetworkfabric.fluent.ExternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.InternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpCommunityListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpPrefixListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.L2IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.L3IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkDeviceSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkDevicesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkFabricControllersClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkFabricSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkFabricsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkRackSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkRacksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkToNetworkInterconnectsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.OperationsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.RoutePoliciesClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AzureNetworkFabricManagementServiceApiImpl type. */ +@ServiceClient(builder = AzureNetworkFabricManagementServiceApiBuilder.class) +public final class AzureNetworkFabricManagementServiceApiImpl implements AzureNetworkFabricManagementServiceApi { + /** 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 AccessControlListsClient object to access its operations. */ + private final AccessControlListsClient accessControlLists; + + /** + * Gets the AccessControlListsClient object to access its operations. + * + * @return the AccessControlListsClient object. + */ + public AccessControlListsClient getAccessControlLists() { + return this.accessControlLists; + } + + /** The IpCommunityListsClient object to access its operations. */ + private final IpCommunityListsClient ipCommunityLists; + + /** + * Gets the IpCommunityListsClient object to access its operations. + * + * @return the IpCommunityListsClient object. + */ + public IpCommunityListsClient getIpCommunityLists() { + return this.ipCommunityLists; + } + + /** The IpPrefixListsClient object to access its operations. */ + private final IpPrefixListsClient ipPrefixLists; + + /** + * Gets the IpPrefixListsClient object to access its operations. + * + * @return the IpPrefixListsClient object. + */ + public IpPrefixListsClient getIpPrefixLists() { + return this.ipPrefixLists; + } + + /** The L2IsolationDomainsClient object to access its operations. */ + private final L2IsolationDomainsClient l2IsolationDomains; + + /** + * Gets the L2IsolationDomainsClient object to access its operations. + * + * @return the L2IsolationDomainsClient object. + */ + public L2IsolationDomainsClient getL2IsolationDomains() { + return this.l2IsolationDomains; + } + + /** The L3IsolationDomainsClient object to access its operations. */ + private final L3IsolationDomainsClient l3IsolationDomains; + + /** + * Gets the L3IsolationDomainsClient object to access its operations. + * + * @return the L3IsolationDomainsClient object. + */ + public L3IsolationDomainsClient getL3IsolationDomains() { + return this.l3IsolationDomains; + } + + /** The InternalNetworksClient object to access its operations. */ + private final InternalNetworksClient internalNetworks; + + /** + * Gets the InternalNetworksClient object to access its operations. + * + * @return the InternalNetworksClient object. + */ + public InternalNetworksClient getInternalNetworks() { + return this.internalNetworks; + } + + /** The ExternalNetworksClient object to access its operations. */ + private final ExternalNetworksClient externalNetworks; + + /** + * Gets the ExternalNetworksClient object to access its operations. + * + * @return the ExternalNetworksClient object. + */ + public ExternalNetworksClient getExternalNetworks() { + return this.externalNetworks; + } + + /** The NetworkDeviceSkusClient object to access its operations. */ + private final NetworkDeviceSkusClient networkDeviceSkus; + + /** + * Gets the NetworkDeviceSkusClient object to access its operations. + * + * @return the NetworkDeviceSkusClient object. + */ + public NetworkDeviceSkusClient getNetworkDeviceSkus() { + return this.networkDeviceSkus; + } + + /** The NetworkDevicesClient object to access its operations. */ + private final NetworkDevicesClient networkDevices; + + /** + * Gets the NetworkDevicesClient object to access its operations. + * + * @return the NetworkDevicesClient object. + */ + public NetworkDevicesClient getNetworkDevices() { + return this.networkDevices; + } + + /** The NetworkInterfacesClient object to access its operations. */ + private final NetworkInterfacesClient networkInterfaces; + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + public NetworkInterfacesClient getNetworkInterfaces() { + return this.networkInterfaces; + } + + /** The NetworkFabricControllersClient object to access its operations. */ + private final NetworkFabricControllersClient networkFabricControllers; + + /** + * Gets the NetworkFabricControllersClient object to access its operations. + * + * @return the NetworkFabricControllersClient object. + */ + public NetworkFabricControllersClient getNetworkFabricControllers() { + return this.networkFabricControllers; + } + + /** The NetworkFabricSkusClient object to access its operations. */ + private final NetworkFabricSkusClient networkFabricSkus; + + /** + * Gets the NetworkFabricSkusClient object to access its operations. + * + * @return the NetworkFabricSkusClient object. + */ + public NetworkFabricSkusClient getNetworkFabricSkus() { + return this.networkFabricSkus; + } + + /** The NetworkFabricsClient object to access its operations. */ + private final NetworkFabricsClient networkFabrics; + + /** + * Gets the NetworkFabricsClient object to access its operations. + * + * @return the NetworkFabricsClient object. + */ + public NetworkFabricsClient getNetworkFabrics() { + return this.networkFabrics; + } + + /** The NetworkToNetworkInterconnectsClient object to access its operations. */ + private final NetworkToNetworkInterconnectsClient networkToNetworkInterconnects; + + /** + * Gets the NetworkToNetworkInterconnectsClient object to access its operations. + * + * @return the NetworkToNetworkInterconnectsClient object. + */ + public NetworkToNetworkInterconnectsClient getNetworkToNetworkInterconnects() { + return this.networkToNetworkInterconnects; + } + + /** The NetworkRackSkusClient object to access its operations. */ + private final NetworkRackSkusClient networkRackSkus; + + /** + * Gets the NetworkRackSkusClient object to access its operations. + * + * @return the NetworkRackSkusClient object. + */ + public NetworkRackSkusClient getNetworkRackSkus() { + return this.networkRackSkus; + } + + /** The NetworkRacksClient object to access its operations. */ + private final NetworkRacksClient networkRacks; + + /** + * Gets the NetworkRacksClient object to access its operations. + * + * @return the NetworkRacksClient object. + */ + public NetworkRacksClient getNetworkRacks() { + return this.networkRacks; + } + + /** 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 RoutePoliciesClient object to access its operations. */ + private final RoutePoliciesClient routePolicies; + + /** + * Gets the RoutePoliciesClient object to access its operations. + * + * @return the RoutePoliciesClient object. + */ + public RoutePoliciesClient getRoutePolicies() { + return this.routePolicies; + } + + /** + * Initializes an instance of AzureNetworkFabricManagementServiceApi 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. + */ + AzureNetworkFabricManagementServiceApiImpl( + 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 = "2023-02-01-preview"; + this.accessControlLists = new AccessControlListsClientImpl(this); + this.ipCommunityLists = new IpCommunityListsClientImpl(this); + this.ipPrefixLists = new IpPrefixListsClientImpl(this); + this.l2IsolationDomains = new L2IsolationDomainsClientImpl(this); + this.l3IsolationDomains = new L3IsolationDomainsClientImpl(this); + this.internalNetworks = new InternalNetworksClientImpl(this); + this.externalNetworks = new ExternalNetworksClientImpl(this); + this.networkDeviceSkus = new NetworkDeviceSkusClientImpl(this); + this.networkDevices = new NetworkDevicesClientImpl(this); + this.networkInterfaces = new NetworkInterfacesClientImpl(this); + this.networkFabricControllers = new NetworkFabricControllersClientImpl(this); + this.networkFabricSkus = new NetworkFabricSkusClientImpl(this); + this.networkFabrics = new NetworkFabricsClientImpl(this); + this.networkToNetworkInterconnects = new NetworkToNetworkInterconnectsClientImpl(this); + this.networkRackSkus = new NetworkRackSkusClientImpl(this); + this.networkRacks = new NetworkRacksClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.routePolicies = new RoutePoliciesClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureNetworkFabricManagementServiceApiImpl.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java new file mode 100644 index 000000000000..68cbf65aa590 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Collections; +import java.util.List; + +public final class ExternalNetworkImpl implements ExternalNetwork, ExternalNetwork.Definition, ExternalNetwork.Update { + private ExternalNetworkInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkToNetworkInterconnectId() { + return this.innerModel().networkToNetworkInterconnectId(); + } + + public List disabledOnResources() { + List inner = this.innerModel().disabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PeeringOption peeringOption() { + return this.innerModel().peeringOption(); + } + + public OptionBProperties optionBProperties() { + return this.innerModel().optionBProperties(); + } + + public ExternalNetworkPropertiesOptionAProperties optionAProperties() { + return this.innerModel().optionAProperties(); + } + + public String importRoutePolicyId() { + return this.innerModel().importRoutePolicyId(); + } + + public String exportRoutePolicyId() { + return this.innerModel().exportRoutePolicyId(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ExternalNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l3IsolationDomainName; + + private String externalNetworkName; + + private ExternalNetworkPatch updateBody; + + public ExternalNetworkImpl withExistingL3IsolationDomain(String resourceGroupName, String l3IsolationDomainName) { + this.resourceGroupName = resourceGroupName; + this.l3IsolationDomainName = l3IsolationDomainName; + return this; + } + + public ExternalNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .create(resourceGroupName, l3IsolationDomainName, externalNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public ExternalNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .create(resourceGroupName, l3IsolationDomainName, externalNetworkName, this.innerModel(), context); + return this; + } + + ExternalNetworkImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new ExternalNetworkInner(); + this.serviceManager = serviceManager; + this.externalNetworkName = name; + } + + public ExternalNetworkImpl update() { + this.updateBody = new ExternalNetworkPatch(); + return this; + } + + public ExternalNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .update(resourceGroupName, l3IsolationDomainName, externalNetworkName, updateBody, Context.NONE); + return this; + } + + public ExternalNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .update(resourceGroupName, l3IsolationDomainName, externalNetworkName, updateBody, context); + return this; + } + + ExternalNetworkImpl( + ExternalNetworkInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l3IsolationDomainName = Utils.getValueFromIdByName(innerObject.id(), "l3IsolationDomains"); + this.externalNetworkName = Utils.getValueFromIdByName(innerObject.id(), "externalNetworks"); + } + + public ExternalNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, Context.NONE) + .getValue(); + return this; + } + + public ExternalNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExternalNetworks() + .getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, context) + .getValue(); + return this; + } + + public void updateAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .externalNetworks() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .externalNetworks() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void updateBgpAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .externalNetworks() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateBgpAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .externalNetworks() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void updateBfdForBgpAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .externalNetworks() + .updateBfdForBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateBfdForBgpAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .externalNetworks() + .updateBfdForBgpAdministrativeState( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void clearIpv6Neighbors(EnableDisableOnResources body) { + serviceManager + .externalNetworks() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void clearIpv6Neighbors(EnableDisableOnResources body, Context context) { + serviceManager + .externalNetworks() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void clearArpEntries(EnableDisableOnResources body) { + serviceManager + .externalNetworks() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void clearArpEntries(EnableDisableOnResources body, Context context) { + serviceManager + .externalNetworks() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public ExternalNetworkImpl withPeeringOption(PeeringOption peeringOption) { + if (isInCreateMode()) { + this.innerModel().withPeeringOption(peeringOption); + return this; + } else { + this.updateBody.withPeeringOption(peeringOption); + return this; + } + } + + public ExternalNetworkImpl withOptionBProperties(OptionBProperties optionBProperties) { + if (isInCreateMode()) { + this.innerModel().withOptionBProperties(optionBProperties); + return this; + } else { + this.updateBody.withOptionBProperties(optionBProperties); + return this; + } + } + + public ExternalNetworkImpl withOptionAProperties(ExternalNetworkPropertiesOptionAProperties optionAProperties) { + this.innerModel().withOptionAProperties(optionAProperties); + return this; + } + + public ExternalNetworkImpl withImportRoutePolicyId(String importRoutePolicyId) { + if (isInCreateMode()) { + this.innerModel().withImportRoutePolicyId(importRoutePolicyId); + return this; + } else { + this.updateBody.withImportRoutePolicyId(importRoutePolicyId); + return this; + } + } + + public ExternalNetworkImpl withExportRoutePolicyId(String exportRoutePolicyId) { + if (isInCreateMode()) { + this.innerModel().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } else { + this.updateBody.withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + } + + public ExternalNetworkImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + public ExternalNetworkImpl withOptionAProperties(OptionAProperties optionAProperties) { + this.updateBody.withOptionAProperties(optionAProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksClientImpl.java new file mode 100644 index 000000000000..e562be301af9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksClientImpl.java @@ -0,0 +1,3350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.ExternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworksList; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +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 ExternalNetworksClient. */ +public final class ExternalNetworksClientImpl implements ExternalNetworksClient { + /** The proxy service used to perform REST calls. */ + private final ExternalNetworksService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of ExternalNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExternalNetworksClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(ExternalNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiExternalNetworks to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface ExternalNetworksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") ExternalNetworkInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") ExternalNetworkPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBgpAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateBgpAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/updateBfdForBgpAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateBfdForBgpAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/clearIpv6Neighbors") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearIpv6Neighbors( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/externalNetworks/{externalNetworkName}/clearArpEntries") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearArpEntries( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("externalNetworkName") String externalNetworkName, + @BodyParam("application/json") EnableDisableOnResources body, + @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); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalNetworkInner> beginCreateAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExternalNetworkInner.class, + ExternalNetworkInner.class, + this.client.getContext()); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalNetworkInner> beginCreateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExternalNetworkInner.class, ExternalNetworkInner.class, context); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalNetworkInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body) { + return this + .beginCreateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalNetworkInner> beginCreate( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalNetworkInner create( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkInner body) { + return createAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Creates ExternalNetwork for Layer3 Isolation Domain for communication of computes with external services + * + *

Creates ExternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalNetworkInner create( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkInner body, + Context context) { + return createAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context).block(); + } + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName 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(), + l3IsolationDomainName, + externalNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName 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(), + l3IsolationDomainName, + externalNetworkName, + accept, + context); + } + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName) { + return getWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, Context context) { + return getWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, context).block(); + } + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalNetworkInner get( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName) { + return getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, Context.NONE).getValue(); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalNetworkInner> beginUpdateAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExternalNetworkInner.class, + ExternalNetworkInner.class, + this.client.getContext()); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExternalNetworkInner> beginUpdateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExternalNetworkInner.class, ExternalNetworkInner.class, context); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalNetworkInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body) { + return this + .beginUpdateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExternalNetworkInner> beginUpdate( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalNetworkInner update( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, ExternalNetworkPatch body) { + return updateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Updates a ExternalNetworks. + * + *

API to update certain properties of the ExternalNetworks resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body ExternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExternalNetworkInner update( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + ExternalNetworkPatch body, + Context context) { + return updateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context).block(); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName 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(), + l3IsolationDomainName, + externalNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName 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(), + l3IsolationDomainName, + externalNetworkName, + accept, + context); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName) { + return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName).getSyncPoller(); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String externalNetworkName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, context) + .getSyncPoller(); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName, String externalNetworkName) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName, String externalNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName, String externalNetworkName) { + deleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName).block(); + } + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName, String externalNetworkName, Context context) { + deleteAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, context).block(); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String l3IsolationDomainName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + 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())); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String l3IsolationDomainName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String l3IsolationDomainName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, l3IsolationDomainName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String l3IsolationDomainName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, l3IsolationDomainName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String l3IsolationDomainName) { + return new PagedIterable<>(listAsync(resourceGroupName, l3IsolationDomainName)); + } + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ExternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String l3IsolationDomainName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, l3IsolationDomainName, context)); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .block(); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + updateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .block(); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateBfdForBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateBfdForBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateBfdForBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateBfdForBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + updateBfdForBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .block(); + } + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .block(); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearIpv6NeighborsWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearIpv6Neighbors( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearIpv6NeighborsWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearIpv6Neighbors( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + Mono>> mono = + clearIpv6NeighborsWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearIpv6NeighborsWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + return this + .beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + return this + .beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + return beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + return beginClearIpv6NeighborsAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + clearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + clearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpEntriesWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpEntriesWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (externalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter externalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + externalNetworkName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + Mono>> mono = + clearArpEntriesWithResponseAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearArpEntriesWithResponseAsync( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + return this + .beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + return this + .beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + return beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + return beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + clearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + clearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 ExternalNetworks 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 URL to get the next list of items + *

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 ExternalNetworks 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksImpl.java new file mode 100644 index 000000000000..b7972e03dbaa --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksImpl.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.ExternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworks; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +public final class ExternalNetworksImpl implements ExternalNetworks { + private static final ClientLogger LOGGER = new ClientLogger(ExternalNetworksImpl.class); + + private final ExternalNetworksClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public ExternalNetworksImpl( + ExternalNetworksClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExternalNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExternalNetwork get(String resourceGroupName, String l3IsolationDomainName, String externalNetworkName) { + ExternalNetworkInner inner = + this.serviceClient().get(resourceGroupName, l3IsolationDomainName, externalNetworkName); + if (inner != null) { + return new ExternalNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String l3IsolationDomainName, String externalNetworkName) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName, externalNetworkName); + } + + public void delete( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName, externalNetworkName, context); + } + + public PagedIterable list(String resourceGroupName, String l3IsolationDomainName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, l3IsolationDomainName); + return Utils.mapPage(inner, inner1 -> new ExternalNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String l3IsolationDomainName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, l3IsolationDomainName, context); + return Utils.mapPage(inner, inner1 -> new ExternalNetworkImpl(inner1, this.manager())); + } + + public void updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateBfdForBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateBfdForBgpAdministrativeState( + resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + this.serviceClient().clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + this + .serviceClient() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public void clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body) { + this.serviceClient().clearArpEntries(resourceGroupName, l3IsolationDomainName, externalNetworkName, body); + } + + public void clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context) { + this + .serviceClient() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, externalNetworkName, body, context); + } + + public ExternalNetwork 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String externalNetworkName = Utils.getValueFromIdByName(id, "externalNetworks"); + if (externalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'externalNetworks'.", id))); + } + return this + .getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String externalNetworkName = Utils.getValueFromIdByName(id, "externalNetworks"); + if (externalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'externalNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, l3IsolationDomainName, externalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String externalNetworkName = Utils.getValueFromIdByName(id, "externalNetworks"); + if (externalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'externalNetworks'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, externalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String externalNetworkName = Utils.getValueFromIdByName(id, "externalNetworks"); + if (externalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'externalNetworks'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, externalNetworkName, context); + } + + private ExternalNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public ExternalNetworkImpl define(String name) { + return new ExternalNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDeviceStatusPropertiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDeviceStatusPropertiesImpl.java new file mode 100644 index 000000000000..cf196faa609a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDeviceStatusPropertiesImpl.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.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.GetDeviceStatusProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OperationalStatus; +import com.azure.resourcemanager.managednetworkfabric.models.PowerCycleState; + +public final class GetDeviceStatusPropertiesImpl implements GetDeviceStatusProperties { + private GetDeviceStatusPropertiesInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + GetDeviceStatusPropertiesImpl( + GetDeviceStatusPropertiesInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OperationalStatus operationalStatus() { + return this.innerModel().operationalStatus(); + } + + public PowerCycleState powerCycleState() { + return this.innerModel().powerCycleState(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public GetDeviceStatusPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDynamicInterfaceMapsPropertiesItemImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDynamicInterfaceMapsPropertiesItemImpl.java new file mode 100644 index 000000000000..15ac2f3aa17d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDynamicInterfaceMapsPropertiesItemImpl.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.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.GetDynamicInterfaceMapsPropertiesItem; + +public final class GetDynamicInterfaceMapsPropertiesItemImpl implements GetDynamicInterfaceMapsPropertiesItem { + private GetDynamicInterfaceMapsPropertiesItemInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + GetDynamicInterfaceMapsPropertiesItemImpl( + GetDynamicInterfaceMapsPropertiesItemInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public String operationalStatus() { + return this.innerModel().operationalStatus(); + } + + public String phyStatus() { + return this.innerModel().phyStatus(); + } + + public String transceiverStatus() { + return this.innerModel().transceiverStatus(); + } + + public String connectedTo() { + return this.innerModel().connectedTo(); + } + + public String name() { + return this.innerModel().name(); + } + + public GetDynamicInterfaceMapsPropertiesItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetStaticInterfaceMapsPropertiesItemImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetStaticInterfaceMapsPropertiesItemImpl.java new file mode 100644 index 000000000000..7ec9b31a51b3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetStaticInterfaceMapsPropertiesItemImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.models.GetStaticInterfaceMapsPropertiesItem; + +public final class GetStaticInterfaceMapsPropertiesItemImpl implements GetStaticInterfaceMapsPropertiesItem { + private GetStaticInterfaceMapsPropertiesItemInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + GetStaticInterfaceMapsPropertiesItemImpl( + GetStaticInterfaceMapsPropertiesItemInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String description() { + return this.innerModel().description(); + } + + public String identifier() { + return this.innerModel().identifier(); + } + + public String interfaceType() { + return this.innerModel().interfaceType(); + } + + public String connectorType() { + return this.innerModel().connectorType(); + } + + public String connectedTo() { + return this.innerModel().connectedTo(); + } + + public Float speed() { + return this.innerModel().speed(); + } + + public Float channelGroupId() { + return this.innerModel().channelGroupId(); + } + + public GetStaticInterfaceMapsPropertiesItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InterfaceStatusImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InterfaceStatusImpl.java new file mode 100644 index 000000000000..8e9dc20b718d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InterfaceStatusImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InterfaceStatusInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceStatus; + +public final class InterfaceStatusImpl implements InterfaceStatus { + private InterfaceStatusInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + InterfaceStatusImpl( + InterfaceStatusInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public String operationalStatus() { + return this.innerModel().operationalStatus(); + } + + public String phyStatus() { + return this.innerModel().phyStatus(); + } + + public String transceiverStatus() { + return this.innerModel().transceiverStatus(); + } + + public String connectedTo() { + return this.innerModel().connectedTo(); + } + + public InterfaceStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworkImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworkImpl.java new file mode 100644 index 000000000000..156007c5f133 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworkImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Collections; +import java.util.List; + +public final class InternalNetworkImpl implements InternalNetwork, InternalNetwork.Definition, InternalNetwork.Update { + private InternalNetworkInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List disabledOnResources() { + List inner = this.innerModel().disabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public List bgpDisabledOnResources() { + List inner = this.innerModel().bgpDisabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List bfdDisabledOnResources() { + List inner = this.innerModel().bfdDisabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List bfdForStaticRoutesDisabledOnResources() { + List inner = this.innerModel().bfdForStaticRoutesDisabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public int vlanId() { + return this.innerModel().vlanId(); + } + + public Integer mtu() { + return this.innerModel().mtu(); + } + + public List connectedIPv4Subnets() { + List inner = + this.innerModel().connectedIPv4Subnets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List connectedIPv6Subnets() { + List inner = + this.innerModel().connectedIPv6Subnets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.innerModel().staticRouteConfiguration(); + } + + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.innerModel().bgpConfiguration(); + } + + public String importRoutePolicyId() { + return this.innerModel().importRoutePolicyId(); + } + + public String exportRoutePolicyId() { + return this.innerModel().exportRoutePolicyId(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public InternalNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l3IsolationDomainName; + + private String internalNetworkName; + + private InternalNetworkPatch updateBody; + + public InternalNetworkImpl withExistingL3IsolationDomain(String resourceGroupName, String l3IsolationDomainName) { + this.resourceGroupName = resourceGroupName; + this.l3IsolationDomainName = l3IsolationDomainName; + return this; + } + + public InternalNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .create(resourceGroupName, l3IsolationDomainName, internalNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public InternalNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .create(resourceGroupName, l3IsolationDomainName, internalNetworkName, this.innerModel(), context); + return this; + } + + InternalNetworkImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new InternalNetworkInner(); + this.serviceManager = serviceManager; + this.internalNetworkName = name; + } + + public InternalNetworkImpl update() { + this.updateBody = new InternalNetworkPatch(); + return this; + } + + public InternalNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .update(resourceGroupName, l3IsolationDomainName, internalNetworkName, updateBody, Context.NONE); + return this; + } + + public InternalNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .update(resourceGroupName, l3IsolationDomainName, internalNetworkName, updateBody, context); + return this; + } + + InternalNetworkImpl( + InternalNetworkInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l3IsolationDomainName = Utils.getValueFromIdByName(innerObject.id(), "l3IsolationDomains"); + this.internalNetworkName = Utils.getValueFromIdByName(innerObject.id(), "internalNetworks"); + } + + public InternalNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, Context.NONE) + .getValue(); + return this; + } + + public InternalNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInternalNetworks() + .getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, context) + .getValue(); + return this; + } + + public void updateAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .internalNetworks() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .internalNetworks() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBgpAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .internalNetworks() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBgpAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .internalNetworks() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBfdForBgpAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .internalNetworks() + .updateBfdForBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBfdForBgpAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .internalNetworks() + .updateBfdForBgpAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void clearIpv6Neighbors(EnableDisableOnResources body) { + serviceManager + .internalNetworks() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void clearIpv6Neighbors(EnableDisableOnResources body, Context context) { + serviceManager + .internalNetworks() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void clearArpEntries(EnableDisableOnResources body) { + serviceManager + .internalNetworks() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void clearArpEntries(EnableDisableOnResources body, Context context) { + serviceManager + .internalNetworks() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBfdForStaticRouteAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .internalNetworks() + .updateBfdForStaticRouteAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBfdForStaticRouteAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .internalNetworks() + .updateBfdForStaticRouteAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public InternalNetworkImpl withVlanId(int vlanId) { + this.innerModel().withVlanId(vlanId); + return this; + } + + public InternalNetworkImpl withMtu(Integer mtu) { + if (isInCreateMode()) { + this.innerModel().withMtu(mtu); + return this; + } else { + this.updateBody.withMtu(mtu); + return this; + } + } + + public InternalNetworkImpl withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + if (isInCreateMode()) { + this.innerModel().withConnectedIPv4Subnets(connectedIPv4Subnets); + return this; + } else { + this.updateBody.withConnectedIPv4Subnets(connectedIPv4Subnets); + return this; + } + } + + public InternalNetworkImpl withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + if (isInCreateMode()) { + this.innerModel().withConnectedIPv6Subnets(connectedIPv6Subnets); + return this; + } else { + this.updateBody.withConnectedIPv6Subnets(connectedIPv6Subnets); + return this; + } + } + + public InternalNetworkImpl withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + if (isInCreateMode()) { + this.innerModel().withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } else { + this.updateBody.withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } + } + + public InternalNetworkImpl withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + if (isInCreateMode()) { + this.innerModel().withBgpConfiguration(bgpConfiguration); + return this; + } else { + this.updateBody.withBgpConfiguration(bgpConfiguration); + return this; + } + } + + public InternalNetworkImpl withImportRoutePolicyId(String importRoutePolicyId) { + if (isInCreateMode()) { + this.innerModel().withImportRoutePolicyId(importRoutePolicyId); + return this; + } else { + this.updateBody.withImportRoutePolicyId(importRoutePolicyId); + return this; + } + } + + public InternalNetworkImpl withExportRoutePolicyId(String exportRoutePolicyId) { + if (isInCreateMode()) { + this.innerModel().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } else { + this.updateBody.withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + } + + public InternalNetworkImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksClientImpl.java new file mode 100644 index 000000000000..60af1b285127 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksClientImpl.java @@ -0,0 +1,3717 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.InternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatch; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworksList; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +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 InternalNetworksClient. */ +public final class InternalNetworksClientImpl implements InternalNetworksClient { + /** The proxy service used to perform REST calls. */ + private final InternalNetworksService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of InternalNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InternalNetworksClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(InternalNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiInternalNetworks to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface InternalNetworksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") InternalNetworkInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") InternalNetworkPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBgpAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateBgpAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdForBgpAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateBfdForBgpAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/clearIpv6Neighbors") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearIpv6Neighbors( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/clearArpEntries") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearArpEntries( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/internalNetworks/{internalNetworkName}/updateBfdForStaticRouteAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateBfdForStaticRouteAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @PathParam("internalNetworkName") String internalNetworkName, + @BodyParam("application/json") UpdateAdministrativeState body, + @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); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InternalNetworkInner> beginCreateAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InternalNetworkInner.class, + InternalNetworkInner.class, + this.client.getContext()); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InternalNetworkInner> beginCreateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), InternalNetworkInner.class, InternalNetworkInner.class, context); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InternalNetworkInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body) { + return this + .beginCreateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InternalNetworkInner> beginCreate( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InternalNetworkInner create( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkInner body) { + return createAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * Creates InternalNetwork for Layer3 Isolation Domain for communication of compute within and across racks. + * + *

Creates InternalNetwork PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InternalNetworkInner create( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkInner body, + Context context) { + return createAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context).block(); + } + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName 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(), + l3IsolationDomainName, + internalNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName 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(), + l3IsolationDomainName, + internalNetworkName, + accept, + context); + } + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName) { + return getWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, Context context) { + return getWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, context).block(); + } + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InternalNetworkInner get( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName) { + return getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, Context.NONE).getValue(); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InternalNetworkInner> beginUpdateAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InternalNetworkInner.class, + InternalNetworkInner.class, + this.client.getContext()); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InternalNetworkInner> beginUpdateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), InternalNetworkInner.class, InternalNetworkInner.class, context); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InternalNetworkInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body) { + return this + .beginUpdateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InternalNetworkInner> beginUpdate( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InternalNetworkInner update( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, InternalNetworkPatch body) { + return updateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * API to update certain properties of the InternalNetworks resources. + * + *

Updates a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body InternalNetwork properties to update. Only annotations are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the InternalNetwork item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InternalNetworkInner update( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + InternalNetworkPatch body, + Context context) { + return updateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context).block(); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName 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(), + l3IsolationDomainName, + internalNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName 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(), + l3IsolationDomainName, + internalNetworkName, + accept, + context); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName) { + return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName).getSyncPoller(); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, String internalNetworkName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, context) + .getSyncPoller(); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName, String internalNetworkName) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName, String internalNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName, String internalNetworkName) { + deleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName).block(); + } + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName, String internalNetworkName, Context context) { + deleteAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, context).block(); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String l3IsolationDomainName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + 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())); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String l3IsolationDomainName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String l3IsolationDomainName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, l3IsolationDomainName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String l3IsolationDomainName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, l3IsolationDomainName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String l3IsolationDomainName) { + return new PagedIterable<>(listAsync(resourceGroupName, l3IsolationDomainName)); + } + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 InternalNetworks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String l3IsolationDomainName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, l3IsolationDomainName, context)); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .block(); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + updateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateBfdForBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForBgpAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateBfdForBgpAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateBfdForBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateBfdForBgpAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForBgpAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + updateBfdForBgpAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateBfdForBgpAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearIpv6NeighborsWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearIpv6Neighbors( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearIpv6NeighborsWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearIpv6Neighbors( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + Mono>> mono = + clearIpv6NeighborsWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearIpv6NeighborsWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + return this + .beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + return this + .beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + return beginClearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearIpv6NeighborsAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + return beginClearIpv6NeighborsAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + clearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + clearIpv6NeighborsAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context).block(); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpEntriesWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpEntriesWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + Mono>> mono = + clearArpEntriesWithResponseAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearArpEntriesWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + return this + .beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + return this + .beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + return beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpEntriesAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + return beginClearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + clearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body).block(); + } + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + clearArpEntriesAsync(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context).block(); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForStaticRouteAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateBfdForStaticRouteAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateBfdForStaticRouteAdministrativeStateWithResponseAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (internalNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter internalNetworkName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateBfdForStaticRouteAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + internalNetworkName, + body, + accept, + context); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForStaticRouteAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + Mono>> mono = + updateBfdForStaticRouteAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForStaticRouteAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateBfdForStaticRouteAdministrativeStateWithResponseAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return this + .beginUpdateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .getSyncPoller(); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .getSyncPoller(); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForStaticRouteAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + return beginUpdateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateBfdForStaticRouteAdministrativeStateAsync( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + updateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body) + .block(); + } + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + updateBfdForStaticRouteAdministrativeStateAsync( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 InternalNetworks 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 URL to get the next list of items + *

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 InternalNetworks 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksImpl.java new file mode 100644 index 000000000000..cdaadc817785 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.InternalNetworksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworks; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +public final class InternalNetworksImpl implements InternalNetworks { + private static final ClientLogger LOGGER = new ClientLogger(InternalNetworksImpl.class); + + private final InternalNetworksClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public InternalNetworksImpl( + InternalNetworksClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new InternalNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InternalNetwork get(String resourceGroupName, String l3IsolationDomainName, String internalNetworkName) { + InternalNetworkInner inner = + this.serviceClient().get(resourceGroupName, l3IsolationDomainName, internalNetworkName); + if (inner != null) { + return new InternalNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String l3IsolationDomainName, String internalNetworkName) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName, internalNetworkName); + } + + public void delete( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName, internalNetworkName, context); + } + + public PagedIterable list(String resourceGroupName, String l3IsolationDomainName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, l3IsolationDomainName); + return Utils.mapPage(inner, inner1 -> new InternalNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String l3IsolationDomainName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, l3IsolationDomainName, context); + return Utils.mapPage(inner, inner1 -> new InternalNetworkImpl(inner1, this.manager())); + } + + public void updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateBfdForBgpAdministrativeState(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateBfdForBgpAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + this.serviceClient().clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + this + .serviceClient() + .clearIpv6Neighbors(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body) { + this.serviceClient().clearArpEntries(resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context) { + this + .serviceClient() + .clearArpEntries(resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public void updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateBfdForStaticRouteAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body); + } + + public void updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateBfdForStaticRouteAdministrativeState( + resourceGroupName, l3IsolationDomainName, internalNetworkName, body, context); + } + + public InternalNetwork 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String internalNetworkName = Utils.getValueFromIdByName(id, "internalNetworks"); + if (internalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'internalNetworks'.", id))); + } + return this + .getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String internalNetworkName = Utils.getValueFromIdByName(id, "internalNetworks"); + if (internalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'internalNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, l3IsolationDomainName, internalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String internalNetworkName = Utils.getValueFromIdByName(id, "internalNetworks"); + if (internalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'internalNetworks'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, internalNetworkName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + String internalNetworkName = Utils.getValueFromIdByName(id, "internalNetworks"); + if (internalNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'internalNetworks'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, internalNetworkName, context); + } + + private InternalNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public InternalNetworkImpl define(String name) { + return new InternalNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListImpl.java new file mode 100644 index 000000000000..0f0b3aea05cf --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.GshutBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.InternetBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityList; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatchPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpCommunityListImpl implements IpCommunityList, IpCommunityList.Definition, IpCommunityList.Update { + private IpCommunityListInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public CommunityActionType action() { + return this.innerModel().action(); + } + + public LocalASBoolean localAS() { + return this.innerModel().localAS(); + } + + public GshutBoolean gshut() { + return this.innerModel().gshut(); + } + + public InternetBoolean internet() { + return this.innerModel().internet(); + } + + public AdvertiseBoolean advertise() { + return this.innerModel().advertise(); + } + + public ExportBoolean export() { + return this.innerModel().export(); + } + + public List communityMembers() { + List inner = this.innerModel().communityMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List evpnEsImportRouteTargets() { + List inner = + this.innerModel().evpnEsImportRouteTargets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IpCommunityListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipCommunityListName; + + private IpCommunityListPatch updateBody; + + public IpCommunityListImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpCommunityList create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .createWithResponse(resourceGroupName, ipCommunityListName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IpCommunityList create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .createWithResponse(resourceGroupName, ipCommunityListName, this.innerModel(), context) + .getValue(); + return this; + } + + IpCommunityListImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new IpCommunityListInner(); + this.serviceManager = serviceManager; + this.ipCommunityListName = name; + } + + public IpCommunityListImpl update() { + this.updateBody = new IpCommunityListPatch(); + return this; + } + + public IpCommunityList apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .updateWithResponse(resourceGroupName, ipCommunityListName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public IpCommunityList apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .updateWithResponse(resourceGroupName, ipCommunityListName, updateBody, context) + .getValue(); + return this; + } + + IpCommunityListImpl( + IpCommunityListInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipCommunityListName = Utils.getValueFromIdByName(innerObject.id(), "ipCommunityLists"); + } + + public IpCommunityList refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, Context.NONE) + .getValue(); + return this; + } + + public IpCommunityList refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunityLists() + .getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, context) + .getValue(); + return this; + } + + public IpCommunityListImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpCommunityListImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpCommunityListImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public IpCommunityListImpl withAction(CommunityActionType action) { + if (isInCreateMode()) { + this.innerModel().withAction(action); + return this; + } else { + this.updateBody.withAction(action); + return this; + } + } + + public IpCommunityListImpl withLocalAS(LocalASBoolean localAS) { + if (isInCreateMode()) { + this.innerModel().withLocalAS(localAS); + return this; + } else { + this.updateBody.withLocalAS(localAS); + return this; + } + } + + public IpCommunityListImpl withGshut(GshutBoolean gshut) { + this.innerModel().withGshut(gshut); + return this; + } + + public IpCommunityListImpl withInternet(InternetBoolean internet) { + this.innerModel().withInternet(internet); + return this; + } + + public IpCommunityListImpl withAdvertise(AdvertiseBoolean advertise) { + if (isInCreateMode()) { + this.innerModel().withAdvertise(advertise); + return this; + } else { + this.updateBody.withAdvertise(advertise); + return this; + } + } + + public IpCommunityListImpl withExport(ExportBoolean export) { + if (isInCreateMode()) { + this.innerModel().withExport(export); + return this; + } else { + this.updateBody.withExport(export); + return this; + } + } + + public IpCommunityListImpl withCommunityMembers( + List communityMembers) { + this.innerModel().withCommunityMembers(communityMembers); + return this; + } + + public IpCommunityListImpl withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets) { + this.innerModel().withEvpnEsImportRouteTargets(evpnEsImportRouteTargets); + return this; + } + + public IpCommunityListImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + public IpCommunityListImpl withCommunityMembersForUpdate( + List communityMembers) { + this.updateBody.withCommunityMembers(communityMembers); + return this; + } + + public IpCommunityListImpl withEvpnEsImportRouteTargetsForUpdate( + List evpnEsImportRouteTargets) { + this.updateBody.withEvpnEsImportRouteTargets(evpnEsImportRouteTargets); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsClientImpl.java new file mode 100644 index 000000000000..9c8bda9076a4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpCommunityListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpCommunityListsClient. */ +public final class IpCommunityListsClientImpl implements IpCommunityListsClient { + /** The proxy service used to perform REST calls. */ + private final IpCommunityListsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of IpCommunityListsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpCommunityListsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(IpCommunityListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiIpCommunityLists to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface IpCommunityListsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists/{ipCommunityListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipCommunityListName") String ipCommunityListName, + @BodyParam("application/json") IpCommunityListInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists/{ipCommunityListName}") + @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("ipCommunityListName") String ipCommunityListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists/{ipCommunityListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipCommunityListName") String ipCommunityListName, + @BodyParam("application/json") IpCommunityListPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists/{ipCommunityListName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipCommunityListName") String ipCommunityListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipCommunityLists") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body) { + 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipCommunityListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body, 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipCommunityListName, + body, + accept, + context); + } + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body) { + return createWithResponseAsync(resourceGroupName, ipCommunityListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body, Context context) { + return createWithResponseAsync(resourceGroupName, ipCommunityListName, body, context).block(); + } + + /** + * Create Ip Community List. + * + *

Implements Ip Community List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityListInner create( + String resourceGroupName, String ipCommunityListName, IpCommunityListInner body) { + return createWithResponse(resourceGroupName, ipCommunityListName, body, Context.NONE).getValue(); + } + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipCommunityListName) { + 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName 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(), + ipCommunityListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipCommunityListName, 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName 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(), + ipCommunityListName, + accept, + context); + } + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipCommunityListName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipCommunityListName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipCommunityListName, context).block(); + } + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityListInner getByResourceGroup(String resourceGroupName, String ipCommunityListName) { + return getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, Context.NONE).getValue(); + } + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body) { + 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipCommunityListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body, 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipCommunityListName, + body, + accept, + context); + } + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body) { + return updateWithResponseAsync(resourceGroupName, ipCommunityListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, ipCommunityListName, body, context).block(); + } + + /** + * Updates a Ip Community List. + * + *

API to update certain properties of the Ip Community List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param body Ip Community List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityListInner update( + String resourceGroupName, String ipCommunityListName, IpCommunityListPatch body) { + return updateWithResponse(resourceGroupName, ipCommunityListName, body, Context.NONE).getValue(); + } + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipCommunityListName) { + 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName 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(), + ipCommunityListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipCommunityListName, 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 (ipCommunityListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityListName 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(), + ipCommunityListName, + accept, + context); + } + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ipCommunityListName) { + return deleteWithResponseAsync(resourceGroupName, ipCommunityListName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String ipCommunityListName, Context context) { + return deleteWithResponseAsync(resourceGroupName, ipCommunityListName, context).block(); + } + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipCommunityListName) { + deleteWithResponse(resourceGroupName, ipCommunityListName, Context.NONE); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists 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())); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists 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)); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists 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)); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @throws 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 IpCommunityLists 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.getSubscriptionId(), + 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())); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpCommunityLists 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @throws 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 IpCommunityLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpCommunityLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @throws 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 IpCommunityLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpCommunityLists 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 URL to get the next list of items + *

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 IpCommunityLists 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 URL to get the next list of items + *

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 IpCommunityLists 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 IpCommunityLists 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 URL to get the next list of items + *

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 IpCommunityLists 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsImpl.java new file mode 100644 index 000000000000..f128ac89429d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityListsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.IpCommunityListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityList; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityLists; + +public final class IpCommunityListsImpl implements IpCommunityLists { + private static final ClientLogger LOGGER = new ClientLogger(IpCommunityListsImpl.class); + + private final IpCommunityListsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public IpCommunityListsImpl( + IpCommunityListsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpCommunityListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IpCommunityList getByResourceGroup(String resourceGroupName, String ipCommunityListName) { + IpCommunityListInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipCommunityListName); + if (inner != null) { + return new IpCommunityListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, ipCommunityListName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String ipCommunityListName) { + this.serviceClient().delete(resourceGroupName, ipCommunityListName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpCommunityListImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpCommunityListImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpCommunityListImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpCommunityListImpl(inner1, this.manager())); + } + + public IpCommunityList 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 ipCommunityListName = Utils.getValueFromIdByName(id, "ipCommunityLists"); + if (ipCommunityListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipCommunityLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, 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 ipCommunityListName = Utils.getValueFromIdByName(id, "ipCommunityLists"); + if (ipCommunityListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipCommunityLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, 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 ipCommunityListName = Utils.getValueFromIdByName(id, "ipCommunityLists"); + if (ipCommunityListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipCommunityLists'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipCommunityListName = Utils.getValueFromIdByName(id, "ipCommunityLists"); + if (ipCommunityListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipCommunityLists'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, ipCommunityListName, context); + } + + private IpCommunityListsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public IpCommunityListImpl define(String name) { + return new IpCommunityListImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListImpl.java new file mode 100644 index 000000000000..00f831c0c630 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixList; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.PrefixActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class IpPrefixListImpl implements IpPrefixList, IpPrefixList.Definition, IpPrefixList.Update { + private IpPrefixListInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrefixActionType action() { + return this.innerModel().action(); + } + + public int sequenceNumber() { + return this.innerModel().sequenceNumber(); + } + + public String networkAddress() { + return this.innerModel().networkAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IpPrefixListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipPrefixListName; + + private IpPrefixListPatch updateBody; + + public IpPrefixListImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpPrefixList create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .createWithResponse(resourceGroupName, ipPrefixListName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public IpPrefixList create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .createWithResponse(resourceGroupName, ipPrefixListName, this.innerModel(), context) + .getValue(); + return this; + } + + IpPrefixListImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new IpPrefixListInner(); + this.serviceManager = serviceManager; + this.ipPrefixListName = name; + } + + public IpPrefixListImpl update() { + this.updateBody = new IpPrefixListPatch(); + return this; + } + + public IpPrefixList apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .updateWithResponse(resourceGroupName, ipPrefixListName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public IpPrefixList apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .updateWithResponse(resourceGroupName, ipPrefixListName, updateBody, context) + .getValue(); + return this; + } + + IpPrefixListImpl( + IpPrefixListInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipPrefixListName = Utils.getValueFromIdByName(innerObject.id(), "ipPrefixLists"); + } + + public IpPrefixList refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, Context.NONE) + .getValue(); + return this; + } + + public IpPrefixList refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixLists() + .getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, context) + .getValue(); + return this; + } + + public IpPrefixListImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpPrefixListImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpPrefixListImpl withAction(PrefixActionType action) { + if (isInCreateMode()) { + this.innerModel().withAction(action); + return this; + } else { + this.updateBody.withAction(action); + return this; + } + } + + public IpPrefixListImpl withSequenceNumber(int sequenceNumber) { + this.innerModel().withSequenceNumber(sequenceNumber); + return this; + } + + public IpPrefixListImpl withNetworkAddress(String networkAddress) { + if (isInCreateMode()) { + this.innerModel().withNetworkAddress(networkAddress); + return this; + } else { + this.updateBody.withNetworkAddress(networkAddress); + return this; + } + } + + public IpPrefixListImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public IpPrefixListImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + public IpPrefixListImpl withSequenceNumber(Integer sequenceNumber) { + this.updateBody.withSequenceNumber(sequenceNumber); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsClientImpl.java new file mode 100644 index 000000000000..f20cd28c112d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsClientImpl.java @@ -0,0 +1,1298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpPrefixListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixListPatch; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixListsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpPrefixListsClient. */ +public final class IpPrefixListsClientImpl implements IpPrefixListsClient { + /** The proxy service used to perform REST calls. */ + private final IpPrefixListsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of IpPrefixListsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpPrefixListsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(IpPrefixListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiIpPrefixLists to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface IpPrefixListsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists/{ipPrefixListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipPrefixListName") String ipPrefixListName, + @BodyParam("application/json") IpPrefixListInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists/{ipPrefixListName}") + @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("ipPrefixListName") String ipPrefixListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists/{ipPrefixListName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipPrefixListName") String ipPrefixListName, + @BodyParam("application/json") IpPrefixListPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists/{ipPrefixListName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("ipPrefixListName") String ipPrefixListName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/ipPrefixLists") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListInner body) { + 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipPrefixListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListInner body, 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipPrefixListName, + body, + accept, + context); + } + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListInner body) { + return createWithResponseAsync(resourceGroupName, ipPrefixListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String ipPrefixListName, IpPrefixListInner body, Context context) { + return createWithResponseAsync(resourceGroupName, ipPrefixListName, body, context).block(); + } + + /** + * Create Ip Prefix List. + * + *

Implements Ip Prefix List PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixListInner create(String resourceGroupName, String ipPrefixListName, IpPrefixListInner body) { + return createWithResponse(resourceGroupName, ipPrefixListName, body, Context.NONE).getValue(); + } + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipPrefixListName) { + 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName 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(), + ipPrefixListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String ipPrefixListName, 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName 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(), + ipPrefixListName, + accept, + context); + } + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipPrefixListName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipPrefixListName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipPrefixListName, context).block(); + } + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixListInner getByResourceGroup(String resourceGroupName, String ipPrefixListName) { + return getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, Context.NONE).getValue(); + } + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body) { + 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipPrefixListName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body, 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + ipPrefixListName, + body, + accept, + context); + } + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body) { + return updateWithResponseAsync(resourceGroupName, ipPrefixListName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body, Context context) { + return updateWithResponseAsync(resourceGroupName, ipPrefixListName, body, context).block(); + } + + /** + * Updates a Ip Prefix List. + * + *

API to update certain properties of the Ip Prefix List resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param body Ip Prefix List properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixListInner update(String resourceGroupName, String ipPrefixListName, IpPrefixListPatch body) { + return updateWithResponse(resourceGroupName, ipPrefixListName, body, Context.NONE).getValue(); + } + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipPrefixListName) { + 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName 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(), + ipPrefixListName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 ipPrefixListName, 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 (ipPrefixListName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipPrefixListName 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(), + ipPrefixListName, + accept, + context); + } + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ipPrefixListName) { + return deleteWithResponseAsync(resourceGroupName, ipPrefixListName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String ipPrefixListName, Context context) { + return deleteWithResponseAsync(resourceGroupName, ipPrefixListName, context).block(); + } + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipPrefixListName) { + deleteWithResponse(resourceGroupName, ipPrefixListName, Context.NONE); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists 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())); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists 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)); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists 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)); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @throws 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 IpPrefixLists 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.getSubscriptionId(), + 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())); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpPrefixLists 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @throws 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 IpPrefixLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpPrefixLists as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @throws 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 IpPrefixLists as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 IpPrefixLists 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 URL to get the next list of items + *

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 IpPrefixLists 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 URL to get the next list of items + *

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 IpPrefixLists 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 IpPrefixLists 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 URL to get the next list of items + *

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 IpPrefixLists 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsImpl.java new file mode 100644 index 000000000000..b53c367b43c3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixListsImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.IpPrefixListsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixList; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixLists; + +public final class IpPrefixListsImpl implements IpPrefixLists { + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixListsImpl.class); + + private final IpPrefixListsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public IpPrefixListsImpl( + IpPrefixListsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpPrefixListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IpPrefixList getByResourceGroup(String resourceGroupName, String ipPrefixListName) { + IpPrefixListInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipPrefixListName); + if (inner != null) { + return new IpPrefixListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, ipPrefixListName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String ipPrefixListName) { + this.serviceClient().delete(resourceGroupName, ipPrefixListName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpPrefixListImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpPrefixListImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpPrefixListImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpPrefixListImpl(inner1, this.manager())); + } + + public IpPrefixList 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 ipPrefixListName = Utils.getValueFromIdByName(id, "ipPrefixLists"); + if (ipPrefixListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, 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 ipPrefixListName = Utils.getValueFromIdByName(id, "ipPrefixLists"); + if (ipPrefixListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, 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 ipPrefixListName = Utils.getValueFromIdByName(id, "ipPrefixLists"); + if (ipPrefixListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixLists'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipPrefixListName = Utils.getValueFromIdByName(id, "ipPrefixLists"); + if (ipPrefixListName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixLists'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, ipPrefixListName, context); + } + + private IpPrefixListsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public IpPrefixListImpl define(String name) { + return new IpPrefixListImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainImpl.java new file mode 100644 index 000000000000..04f0cb46b1d1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.ArpProperties; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class L2IsolationDomainImpl + implements L2IsolationDomain, L2IsolationDomain.Definition, L2IsolationDomain.Update { + private L2IsolationDomainInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkFabricId() { + return this.innerModel().networkFabricId(); + } + + public int vlanId() { + return this.innerModel().vlanId(); + } + + public Integer mtu() { + return this.innerModel().mtu(); + } + + public List disabledOnResources() { + List inner = this.innerModel().disabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public L2IsolationDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l2IsolationDomainName; + + private L2IsolationDomainPatch updateBody; + + public L2IsolationDomainImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public L2IsolationDomain create() { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .create(resourceGroupName, l2IsolationDomainName, this.innerModel(), Context.NONE); + return this; + } + + public L2IsolationDomain create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .create(resourceGroupName, l2IsolationDomainName, this.innerModel(), context); + return this; + } + + L2IsolationDomainImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new L2IsolationDomainInner(); + this.serviceManager = serviceManager; + this.l2IsolationDomainName = name; + } + + public L2IsolationDomainImpl update() { + this.updateBody = new L2IsolationDomainPatch(); + return this; + } + + public L2IsolationDomain apply() { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .update(resourceGroupName, l2IsolationDomainName, updateBody, Context.NONE); + return this; + } + + public L2IsolationDomain apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .update(resourceGroupName, l2IsolationDomainName, updateBody, context); + return this; + } + + L2IsolationDomainImpl( + L2IsolationDomainInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l2IsolationDomainName = Utils.getValueFromIdByName(innerObject.id(), "l2IsolationDomains"); + } + + public L2IsolationDomain refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, Context.NONE) + .getValue(); + return this; + } + + public L2IsolationDomain refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2IsolationDomains() + .getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, context) + .getValue(); + return this; + } + + public void updateAdministrativeState(UpdateAdministrativeState body) { + serviceManager.l2IsolationDomains().updateAdministrativeState(resourceGroupName, l2IsolationDomainName, body); + } + + public void updateAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .l2IsolationDomains() + .updateAdministrativeState(resourceGroupName, l2IsolationDomainName, body, context); + } + + public void clearArpTable(EnableDisableOnResources body) { + serviceManager.l2IsolationDomains().clearArpTable(resourceGroupName, l2IsolationDomainName, body); + } + + public void clearArpTable(EnableDisableOnResources body, Context context) { + serviceManager.l2IsolationDomains().clearArpTable(resourceGroupName, l2IsolationDomainName, body, context); + } + + public void clearNeighborTable(EnableDisableOnResources body) { + serviceManager.l2IsolationDomains().clearNeighborTable(resourceGroupName, l2IsolationDomainName, body); + } + + public void clearNeighborTable(EnableDisableOnResources body, Context context) { + serviceManager.l2IsolationDomains().clearNeighborTable(resourceGroupName, l2IsolationDomainName, body, context); + } + + public Map getArpEntries() { + return serviceManager.l2IsolationDomains().getArpEntries(resourceGroupName, l2IsolationDomainName); + } + + public Map getArpEntries(Context context) { + return serviceManager.l2IsolationDomains().getArpEntries(resourceGroupName, l2IsolationDomainName, context); + } + + public L2IsolationDomainImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public L2IsolationDomainImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public L2IsolationDomainImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public L2IsolationDomainImpl withNetworkFabricId(String networkFabricId) { + this.innerModel().withNetworkFabricId(networkFabricId); + return this; + } + + public L2IsolationDomainImpl withVlanId(int vlanId) { + this.innerModel().withVlanId(vlanId); + return this; + } + + public L2IsolationDomainImpl withMtu(Integer mtu) { + if (isInCreateMode()) { + this.innerModel().withMtu(mtu); + return this; + } else { + this.updateBody.withMtu(mtu); + return this; + } + } + + public L2IsolationDomainImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsClientImpl.java new file mode 100644 index 000000000000..f48d1b8f8a01 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsClientImpl.java @@ -0,0 +1,2848 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.L2IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ArpPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomainsListResult; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import com.fasterxml.jackson.core.type.TypeReference; +import java.nio.ByteBuffer; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in L2IsolationDomainsClient. */ +public final class L2IsolationDomainsClientImpl implements L2IsolationDomainsClient { + /** The proxy service used to perform REST calls. */ + private final L2IsolationDomainsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of L2IsolationDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + L2IsolationDomainsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(L2IsolationDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiL2IsolationDomains to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface L2IsolationDomainsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @BodyParam("application/json") L2IsolationDomainInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}") + @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("l2IsolationDomainName") String l2IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @BodyParam("application/json") L2IsolationDomainPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}") + @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("l2IsolationDomainName") String l2IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/updateAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/clearArpTable") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearArpTable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/clearNeighborTable") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearNeighborTable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName}/getArpEntries") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getArpEntries( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l2IsolationDomainName") String l2IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2IsolationDomainInner> beginCreateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, l2IsolationDomainName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L2IsolationDomainInner.class, + L2IsolationDomainInner.class, + this.client.getContext()); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2IsolationDomainInner> beginCreateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, l2IsolationDomainName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L2IsolationDomainInner.class, + L2IsolationDomainInner.class, + context); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2IsolationDomainInner> beginCreate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body) { + return this.beginCreateAsync(resourceGroupName, l2IsolationDomainName, body).getSyncPoller(); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2IsolationDomainInner> beginCreate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, l2IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body) { + return beginCreateAsync(resourceGroupName, l2IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context) { + return beginCreateAsync(resourceGroupName, l2IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2IsolationDomainInner create( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body) { + return createAsync(resourceGroupName, l2IsolationDomainName, body).block(); + } + + /** + * Create L2 Isolation Domain. + * + *

Creates layer 2 network connectivity between compute nodes within a rack and across racks.The configuration is + * applied on the devices only after the isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2IsolationDomainInner create( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainInner body, Context context) { + return createAsync(resourceGroupName, l2IsolationDomainName, body, context).block(); + } + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName 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(), + l2IsolationDomainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName 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(), + l2IsolationDomainName, + accept, + context); + } + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String l2IsolationDomainName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l2IsolationDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l2IsolationDomainName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l2IsolationDomainName, context).block(); + } + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2IsolationDomainInner getByResourceGroup(String resourceGroupName, String l2IsolationDomainName) { + return getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, Context.NONE).getValue(); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2IsolationDomainInner> beginUpdateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, l2IsolationDomainName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L2IsolationDomainInner.class, + L2IsolationDomainInner.class, + this.client.getContext()); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2IsolationDomainInner> beginUpdateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l2IsolationDomainName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L2IsolationDomainInner.class, + L2IsolationDomainInner.class, + context); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2IsolationDomainInner> beginUpdate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body) { + return this.beginUpdateAsync(resourceGroupName, l2IsolationDomainName, body).getSyncPoller(); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2IsolationDomainInner> beginUpdate( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, l2IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body) { + return beginUpdateAsync(resourceGroupName, l2IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, l2IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2IsolationDomainInner update( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body) { + return updateAsync(resourceGroupName, l2IsolationDomainName, body).block(); + } + + /** + * Updates a L2 Isolation Domain. + * + *

API to update certain properties of the L2 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param body API to update certain properties of the L2 Isolation Domain resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2IsolationDomainInner update( + String resourceGroupName, String l2IsolationDomainName, L2IsolationDomainPatch body, Context context) { + return updateAsync(resourceGroupName, l2IsolationDomainName, body, context).block(); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName 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(), + l2IsolationDomainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName 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(), + l2IsolationDomainName, + accept, + context); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l2IsolationDomainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l2IsolationDomainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName) { + return this.beginDeleteAsync(resourceGroupName, l2IsolationDomainName).getSyncPoller(); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l2IsolationDomainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, l2IsolationDomainName, context).getSyncPoller(); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l2IsolationDomainName) { + return beginDeleteAsync(resourceGroupName, l2IsolationDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l2IsolationDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, l2IsolationDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l2IsolationDomainName) { + deleteAsync(resourceGroupName, l2IsolationDomainName).block(); + } + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l2IsolationDomainName, Context context) { + deleteAsync(resourceGroupName, l2IsolationDomainName, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + Mono>> mono = + updateAdministrativeStateWithResponseAsync(resourceGroupName, l2IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAdministrativeStateWithResponseAsync(resourceGroupName, l2IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + return this.beginUpdateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context) { + return this + .beginUpdateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + updateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context) { + updateAdministrativeStateAsync(resourceGroupName, l2IsolationDomainName, body, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpTableWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearArpTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpTableWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearArpTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + Mono>> mono = + clearArpTableWithResponseAsync(resourceGroupName, l2IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearArpTableWithResponseAsync(resourceGroupName, l2IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + return this.beginClearArpTableAsync(resourceGroupName, l2IsolationDomainName, body).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + return this.beginClearArpTableAsync(resourceGroupName, l2IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + return beginClearArpTableAsync(resourceGroupName, l2IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + return beginClearArpTableAsync(resourceGroupName, l2IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + clearArpTableAsync(resourceGroupName, l2IsolationDomainName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + clearArpTableAsync(resourceGroupName, l2IsolationDomainName, body, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearNeighborTableWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearNeighborTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearNeighborTableWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearNeighborTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + Mono>> mono = + clearNeighborTableWithResponseAsync(resourceGroupName, l2IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearNeighborTableWithResponseAsync(resourceGroupName, l2IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + return this.beginClearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + return this + .beginClearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearNeighborTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + return beginClearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearNeighborTableAsync( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + return beginClearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + clearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + clearNeighborTableAsync(resourceGroupName, l2IsolationDomainName, body, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getArpEntriesWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName) { + 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getArpEntriesWithResponseAsync( + String resourceGroupName, String l2IsolationDomainName, 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 (l2IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2IsolationDomainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getArpEntries( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l2IsolationDomainName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>, Map> + beginGetArpEntriesAsync(String resourceGroupName, String l2IsolationDomainName) { + Mono>> mono = + getArpEntriesWithResponseAsync(resourceGroupName, l2IsolationDomainName); + return this + .client + ., Map>getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>, Map> + beginGetArpEntriesAsync(String resourceGroupName, String l2IsolationDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getArpEntriesWithResponseAsync(resourceGroupName, l2IsolationDomainName, context); + return this + .client + ., Map>getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, Map> beginGetArpEntries( + String resourceGroupName, String l2IsolationDomainName) { + return this.beginGetArpEntriesAsync(resourceGroupName, l2IsolationDomainName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>, Map> beginGetArpEntries( + String resourceGroupName, String l2IsolationDomainName, Context context) { + return this.beginGetArpEntriesAsync(resourceGroupName, l2IsolationDomainName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getArpEntriesAsync( + String resourceGroupName, String l2IsolationDomainName) { + return beginGetArpEntriesAsync(resourceGroupName, l2IsolationDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getArpEntriesAsync( + String resourceGroupName, String l2IsolationDomainName, Context context) { + return beginGetArpEntriesAsync(resourceGroupName, l2IsolationDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map getArpEntries(String resourceGroupName, String l2IsolationDomainName) { + return getArpEntriesAsync(resourceGroupName, l2IsolationDomainName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map getArpEntries( + String resourceGroupName, String l2IsolationDomainName, Context context) { + return getArpEntriesAsync(resourceGroupName, l2IsolationDomainName, context).block(); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains 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())); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains 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)); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains 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)); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @throws 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 L2IsolationDomains 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.getSubscriptionId(), + 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())); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L2IsolationDomains 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @throws 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 L2IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L2IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @throws 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 L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L2IsolationDomains 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 URL to get the next list of items + *

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 L2IsolationDomains 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 URL to get the next list of items + *

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 L2IsolationDomains 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 L2IsolationDomains 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 URL to get the next list of items + *

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 L2IsolationDomains 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsImpl.java new file mode 100644 index 000000000000..775d7a7acfc5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.L2IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ArpPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.ArpProperties; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomains; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Collections; +import java.util.Map; +import java.util.stream.Collectors; + +public final class L2IsolationDomainsImpl implements L2IsolationDomains { + private static final ClientLogger LOGGER = new ClientLogger(L2IsolationDomainsImpl.class); + + private final L2IsolationDomainsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public L2IsolationDomainsImpl( + L2IsolationDomainsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l2IsolationDomainName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new L2IsolationDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public L2IsolationDomain getByResourceGroup(String resourceGroupName, String l2IsolationDomainName) { + L2IsolationDomainInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, l2IsolationDomainName); + if (inner != null) { + return new L2IsolationDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String l2IsolationDomainName) { + this.serviceClient().delete(resourceGroupName, l2IsolationDomainName); + } + + public void delete(String resourceGroupName, String l2IsolationDomainName, Context context) { + this.serviceClient().delete(resourceGroupName, l2IsolationDomainName, context); + } + + public void updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body) { + this.serviceClient().updateAdministrativeState(resourceGroupName, l2IsolationDomainName, body); + } + + public void updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context) { + this.serviceClient().updateAdministrativeState(resourceGroupName, l2IsolationDomainName, body, context); + } + + public void clearArpTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + this.serviceClient().clearArpTable(resourceGroupName, l2IsolationDomainName, body); + } + + public void clearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + this.serviceClient().clearArpTable(resourceGroupName, l2IsolationDomainName, body, context); + } + + public void clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body) { + this.serviceClient().clearNeighborTable(resourceGroupName, l2IsolationDomainName, body); + } + + public void clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context) { + this.serviceClient().clearNeighborTable(resourceGroupName, l2IsolationDomainName, body, context); + } + + public Map getArpEntries(String resourceGroupName, String l2IsolationDomainName) { + Map inner = + this.serviceClient().getArpEntries(resourceGroupName, l2IsolationDomainName); + if (inner != null) { + return Collections + .unmodifiableMap( + inner + .entrySet() + .stream() + .collect( + Collectors + .toMap( + Map.Entry::getKey, + inner1 -> new ArpPropertiesImpl(inner1.getValue(), this.manager())))); + } else { + return Collections.emptyMap(); + } + } + + public Map getArpEntries( + String resourceGroupName, String l2IsolationDomainName, Context context) { + Map inner = + this.serviceClient().getArpEntries(resourceGroupName, l2IsolationDomainName, context); + if (inner != null) { + return Collections + .unmodifiableMap( + inner + .entrySet() + .stream() + .collect( + Collectors + .toMap( + Map.Entry::getKey, + inner1 -> new ArpPropertiesImpl(inner1.getValue(), this.manager())))); + } else { + return Collections.emptyMap(); + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new L2IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new L2IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new L2IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new L2IsolationDomainImpl(inner1, this.manager())); + } + + public L2IsolationDomain 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 l2IsolationDomainName = Utils.getValueFromIdByName(id, "l2IsolationDomains"); + if (l2IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l2IsolationDomains'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, 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 l2IsolationDomainName = Utils.getValueFromIdByName(id, "l2IsolationDomains"); + if (l2IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l2IsolationDomains'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l2IsolationDomainName, 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 l2IsolationDomainName = Utils.getValueFromIdByName(id, "l2IsolationDomains"); + if (l2IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l2IsolationDomains'.", id))); + } + this.delete(resourceGroupName, l2IsolationDomainName, 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 l2IsolationDomainName = Utils.getValueFromIdByName(id, "l2IsolationDomains"); + if (l2IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l2IsolationDomains'.", id))); + } + this.delete(resourceGroupName, l2IsolationDomainName, context); + } + + private L2IsolationDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public L2IsolationDomainImpl define(String name) { + return new L2IsolationDomainImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainImpl.java new file mode 100644 index 000000000000..9748c791a47a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainImpl.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class L3IsolationDomainImpl + implements L3IsolationDomain, L3IsolationDomain.Definition, L3IsolationDomain.Update { + private L3IsolationDomainInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkFabricId() { + return this.innerModel().networkFabricId(); + } + + public List disabledOnResources() { + List inner = this.innerModel().disabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public List optionBDisabledOnResources() { + List inner = this.innerModel().optionBDisabledOnResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RedistributeConnectedSubnets redistributeConnectedSubnets() { + return this.innerModel().redistributeConnectedSubnets(); + } + + public RedistributeStaticRoutes redistributeStaticRoutes() { + return this.innerModel().redistributeStaticRoutes(); + } + + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration() { + return this.innerModel().aggregateRouteConfiguration(); + } + + public String description() { + return this.innerModel().description(); + } + + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy() { + return this.innerModel().connectedSubnetRoutePolicy(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public L3IsolationDomainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l3IsolationDomainName; + + private L3IsolationDomainPatch updateBody; + + public L3IsolationDomainImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public L3IsolationDomain create() { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .create(resourceGroupName, l3IsolationDomainName, this.innerModel(), Context.NONE); + return this; + } + + public L3IsolationDomain create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .create(resourceGroupName, l3IsolationDomainName, this.innerModel(), context); + return this; + } + + L3IsolationDomainImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new L3IsolationDomainInner(); + this.serviceManager = serviceManager; + this.l3IsolationDomainName = name; + } + + public L3IsolationDomainImpl update() { + this.updateBody = new L3IsolationDomainPatch(); + return this; + } + + public L3IsolationDomain apply() { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .update(resourceGroupName, l3IsolationDomainName, updateBody, Context.NONE); + return this; + } + + public L3IsolationDomain apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .update(resourceGroupName, l3IsolationDomainName, updateBody, context); + return this; + } + + L3IsolationDomainImpl( + L3IsolationDomainInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l3IsolationDomainName = Utils.getValueFromIdByName(innerObject.id(), "l3IsolationDomains"); + } + + public L3IsolationDomain refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, Context.NONE) + .getValue(); + return this; + } + + public L3IsolationDomain refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3IsolationDomains() + .getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, context) + .getValue(); + return this; + } + + public void updateAdministrativeState(UpdateAdministrativeState body) { + serviceManager.l3IsolationDomains().updateAdministrativeState(resourceGroupName, l3IsolationDomainName, body); + } + + public void updateAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .l3IsolationDomains() + .updateAdministrativeState(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void updateOptionBAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .l3IsolationDomains() + .updateOptionBAdministrativeState(resourceGroupName, l3IsolationDomainName, body); + } + + public void updateOptionBAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .l3IsolationDomains() + .updateOptionBAdministrativeState(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void clearArpTable(EnableDisableOnResources body) { + serviceManager.l3IsolationDomains().clearArpTable(resourceGroupName, l3IsolationDomainName, body); + } + + public void clearArpTable(EnableDisableOnResources body, Context context) { + serviceManager.l3IsolationDomains().clearArpTable(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void clearNeighborTable(EnableDisableOnResources body) { + serviceManager.l3IsolationDomains().clearNeighborTable(resourceGroupName, l3IsolationDomainName, body); + } + + public void clearNeighborTable(EnableDisableOnResources body, Context context) { + serviceManager.l3IsolationDomains().clearNeighborTable(resourceGroupName, l3IsolationDomainName, body, context); + } + + public L3IsolationDomainImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public L3IsolationDomainImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public L3IsolationDomainImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public L3IsolationDomainImpl withNetworkFabricId(String networkFabricId) { + this.innerModel().withNetworkFabricId(networkFabricId); + return this; + } + + public L3IsolationDomainImpl withRedistributeConnectedSubnets( + RedistributeConnectedSubnets redistributeConnectedSubnets) { + if (isInCreateMode()) { + this.innerModel().withRedistributeConnectedSubnets(redistributeConnectedSubnets); + return this; + } else { + this.updateBody.withRedistributeConnectedSubnets(redistributeConnectedSubnets); + return this; + } + } + + public L3IsolationDomainImpl withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes) { + if (isInCreateMode()) { + this.innerModel().withRedistributeStaticRoutes(redistributeStaticRoutes); + return this; + } else { + this.updateBody.withRedistributeStaticRoutes(redistributeStaticRoutes); + return this; + } + } + + public L3IsolationDomainImpl withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration) { + if (isInCreateMode()) { + this.innerModel().withAggregateRouteConfiguration(aggregateRouteConfiguration); + return this; + } else { + this.updateBody.withAggregateRouteConfiguration(aggregateRouteConfiguration); + return this; + } + } + + public L3IsolationDomainImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateBody.withDescription(description); + return this; + } + } + + public L3IsolationDomainImpl withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) { + if (isInCreateMode()) { + this.innerModel().withConnectedSubnetRoutePolicy(connectedSubnetRoutePolicy); + return this; + } else { + this.updateBody.withConnectedSubnetRoutePolicy(connectedSubnetRoutePolicy); + return this; + } + } + + public L3IsolationDomainImpl withAnnotation(String annotation) { + this.innerModel().withAnnotation(annotation); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsClientImpl.java new file mode 100644 index 000000000000..da683a853b65 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsClientImpl.java @@ -0,0 +1,2866 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.L3IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatch; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainsListResult; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +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 L3IsolationDomainsClient. */ +public final class L3IsolationDomainsClientImpl implements L3IsolationDomainsClient { + /** The proxy service used to perform REST calls. */ + private final L3IsolationDomainsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of L3IsolationDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + L3IsolationDomainsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(L3IsolationDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiL3IsolationDomains to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface L3IsolationDomainsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") L3IsolationDomainInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") L3IsolationDomainPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}") + @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("l3IsolationDomainName") String l3IsolationDomainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateOptionBAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateOptionBAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") UpdateAdministrativeState body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearArpTable") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearArpTable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") EnableDisableOnResources body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearNeighborTable") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> clearNeighborTable( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("l3IsolationDomainName") String l3IsolationDomainName, + @BodyParam("application/json") EnableDisableOnResources body, + @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); + + @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); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3IsolationDomainInner> beginCreateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L3IsolationDomainInner.class, + L3IsolationDomainInner.class, + this.client.getContext()); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3IsolationDomainInner> beginCreateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L3IsolationDomainInner.class, + L3IsolationDomainInner.class, + context); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3IsolationDomainInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) { + return this.beginCreateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller(); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3IsolationDomainInner> beginCreate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) { + return beginCreateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3IsolationDomainInner create( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) { + return createAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * Create L3 Isolation Domain. + * + *

Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with + * external services .This configuration is applied on the devices only after the creation of networks is completed + * and isolation domain is enabled. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3IsolationDomainInner create( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) { + return createAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName 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(), + l3IsolationDomainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName 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(), + l3IsolationDomainName, + accept, + context); + } + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String l3IsolationDomainName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l3IsolationDomainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l3IsolationDomainName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l3IsolationDomainName, context).block(); + } + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3IsolationDomainInner getByResourceGroup(String resourceGroupName, String l3IsolationDomainName) { + return getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, Context.NONE).getValue(); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3IsolationDomainInner> beginUpdateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L3IsolationDomainInner.class, + L3IsolationDomainInner.class, + this.client.getContext()); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3IsolationDomainInner> beginUpdateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L3IsolationDomainInner.class, + L3IsolationDomainInner.class, + context); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3IsolationDomainInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) { + return this.beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller(); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3IsolationDomainInner> beginUpdate( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3IsolationDomainInner update( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) { + return updateAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * Updates a L3 Isolation Domain. + * + *

API to update certain properties of the L3 Isolation Domain resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param body API to update certain properties of the L3 Isolation Domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3IsolationDomainInner update( + String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) { + return updateAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName 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(), + l3IsolationDomainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName 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(), + l3IsolationDomainName, + accept, + context); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName) { + return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName).getSyncPoller(); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 l3IsolationDomainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName, context).getSyncPoller(); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 l3IsolationDomainName, Context context) { + return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName) { + deleteAsync(resourceGroupName, l3IsolationDomainName).block(); + } + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 l3IsolationDomainName, Context context) { + deleteAsync(resourceGroupName, l3IsolationDomainName, context).block(); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains 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())); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains 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)); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains 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)); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @throws 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 L3IsolationDomains 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.getSubscriptionId(), + 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())); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L3IsolationDomains 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @throws 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 L3IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L3IsolationDomains as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @throws 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 L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + Mono>> mono = + updateAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + return this.beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller(); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + return this + .beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .getSyncPoller(); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateOptionBAdministrativeStateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateOptionBAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateOptionBAdministrativeStateWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateOptionBAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateOptionBAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + Mono>> mono = + updateOptionBAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateOptionBAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateOptionBAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + return this + .beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body) + .getSyncPoller(); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + return this + .beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .getSyncPoller(); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateOptionBAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + return beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateOptionBAdministrativeStateAsync( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + return beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + updateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + updateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpTableWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearArpTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearArpTableWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearArpTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + Mono>> mono = + clearArpTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearArpTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + return this.beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller(); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + return this.beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller(); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + return beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearArpTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + return beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + clearArpTableAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + clearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearNeighborTableWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearNeighborTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> clearNeighborTableWithResponseAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, 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 (l3IsolationDomainName == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearNeighborTable( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + l3IsolationDomainName, + body, + accept, + context); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + Mono>> mono = + clearNeighborTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + clearNeighborTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + return this.beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller(); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginClearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + return this + .beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context) + .getSyncPoller(); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearNeighborTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + return beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 clearNeighborTableAsync( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + return beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + clearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body).block(); + } + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + clearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 L3IsolationDomains 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 URL to get the next list of items + *

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 L3IsolationDomains 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 L3IsolationDomains 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 URL to get the next list of items + *

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 L3IsolationDomains 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsImpl.java new file mode 100644 index 000000000000..dcd77ae00b02 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.L3IsolationDomainsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomains; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +public final class L3IsolationDomainsImpl implements L3IsolationDomains { + private static final ClientLogger LOGGER = new ClientLogger(L3IsolationDomainsImpl.class); + + private final L3IsolationDomainsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public L3IsolationDomainsImpl( + L3IsolationDomainsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l3IsolationDomainName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new L3IsolationDomainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public L3IsolationDomain getByResourceGroup(String resourceGroupName, String l3IsolationDomainName) { + L3IsolationDomainInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, l3IsolationDomainName); + if (inner != null) { + return new L3IsolationDomainImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String l3IsolationDomainName) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName); + } + + public void delete(String resourceGroupName, String l3IsolationDomainName, Context context) { + this.serviceClient().delete(resourceGroupName, l3IsolationDomainName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new L3IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new L3IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new L3IsolationDomainImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new L3IsolationDomainImpl(inner1, this.manager())); + } + + public void updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + this.serviceClient().updateAdministrativeState(resourceGroupName, l3IsolationDomainName, body); + } + + public void updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + this.serviceClient().updateAdministrativeState(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) { + this.serviceClient().updateOptionBAdministrativeState(resourceGroupName, l3IsolationDomainName, body); + } + + public void updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) { + this.serviceClient().updateOptionBAdministrativeState(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void clearArpTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + this.serviceClient().clearArpTable(resourceGroupName, l3IsolationDomainName, body); + } + + public void clearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + this.serviceClient().clearArpTable(resourceGroupName, l3IsolationDomainName, body, context); + } + + public void clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) { + this.serviceClient().clearNeighborTable(resourceGroupName, l3IsolationDomainName, body); + } + + public void clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) { + this.serviceClient().clearNeighborTable(resourceGroupName, l3IsolationDomainName, body, context); + } + + public L3IsolationDomain 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, 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 l3IsolationDomainName = Utils.getValueFromIdByName(id, "l3IsolationDomains"); + if (l3IsolationDomainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'l3IsolationDomains'.", id))); + } + this.delete(resourceGroupName, l3IsolationDomainName, context); + } + + private L3IsolationDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public L3IsolationDomainImpl define(String name) { + return new L3IsolationDomainImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceImpl.java new file mode 100644 index 000000000000..834a09f4cbaf --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceImpl.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import com.azure.resourcemanager.managednetworkfabric.models.GetDeviceStatusProperties; +import com.azure.resourcemanager.managednetworkfabric.models.GetDynamicInterfaceMapsPropertiesItem; +import com.azure.resourcemanager.managednetworkfabric.models.GetStaticInterfaceMapsPropertiesItem; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicePatchParameters; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.SupportPackageProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkDeviceImpl implements NetworkDevice, NetworkDevice.Definition, NetworkDevice.Update { + private NetworkDeviceInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String version() { + return this.innerModel().version(); + } + + public String networkDeviceSku() { + return this.innerModel().networkDeviceSku(); + } + + public NetworkDeviceRoleTypes networkDeviceRole() { + return this.innerModel().networkDeviceRole(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String networkRackId() { + return this.innerModel().networkRackId(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkDeviceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkDeviceName; + + private NetworkDevicePatchParameters updateBody; + + public NetworkDeviceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkDevice create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .create(resourceGroupName, networkDeviceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkDevice create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .create(resourceGroupName, networkDeviceName, this.innerModel(), context); + return this; + } + + NetworkDeviceImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkDeviceInner(); + this.serviceManager = serviceManager; + this.networkDeviceName = name; + } + + public NetworkDeviceImpl update() { + this.updateBody = new NetworkDevicePatchParameters(); + return this; + } + + public NetworkDevice apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .update(resourceGroupName, networkDeviceName, updateBody, Context.NONE); + return this; + } + + public NetworkDevice apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .update(resourceGroupName, networkDeviceName, updateBody, context); + return this; + } + + NetworkDeviceImpl( + NetworkDeviceInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkDeviceName = Utils.getValueFromIdByName(innerObject.id(), "networkDevices"); + } + + public NetworkDevice refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, Context.NONE) + .getValue(); + return this; + } + + public NetworkDevice refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkDevices() + .getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, context) + .getValue(); + return this; + } + + public void reboot() { + serviceManager.networkDevices().reboot(resourceGroupName, networkDeviceName); + } + + public void reboot(Context context) { + serviceManager.networkDevices().reboot(resourceGroupName, networkDeviceName, context); + } + + public void restoreConfig() { + serviceManager.networkDevices().restoreConfig(resourceGroupName, networkDeviceName); + } + + public void restoreConfig(Context context) { + serviceManager.networkDevices().restoreConfig(resourceGroupName, networkDeviceName, context); + } + + public void updateVersion(UpdateVersionProperties body) { + serviceManager.networkDevices().updateVersion(resourceGroupName, networkDeviceName, body); + } + + public void updateVersion(UpdateVersionProperties body, Context context) { + serviceManager.networkDevices().updateVersion(resourceGroupName, networkDeviceName, body, context); + } + + public SupportPackageProperties generateSupportPackage() { + return serviceManager.networkDevices().generateSupportPackage(resourceGroupName, networkDeviceName); + } + + public SupportPackageProperties generateSupportPackage(Context context) { + return serviceManager.networkDevices().generateSupportPackage(resourceGroupName, networkDeviceName, context); + } + + public void updatePowerCycle(UpdatePowerCycleProperties body) { + serviceManager.networkDevices().updatePowerCycle(resourceGroupName, networkDeviceName, body); + } + + public void updatePowerCycle(UpdatePowerCycleProperties body, Context context) { + serviceManager.networkDevices().updatePowerCycle(resourceGroupName, networkDeviceName, body, context); + } + + public GetDeviceStatusProperties getStatus() { + return serviceManager.networkDevices().getStatus(resourceGroupName, networkDeviceName); + } + + public GetDeviceStatusProperties getStatus(Context context) { + return serviceManager.networkDevices().getStatus(resourceGroupName, networkDeviceName, context); + } + + public List getStaticInterfaceMaps() { + return serviceManager.networkDevices().getStaticInterfaceMaps(resourceGroupName, networkDeviceName); + } + + public List getStaticInterfaceMaps(Context context) { + return serviceManager.networkDevices().getStaticInterfaceMaps(resourceGroupName, networkDeviceName, context); + } + + public List getDynamicInterfaceMaps() { + return serviceManager.networkDevices().getDynamicInterfaceMaps(resourceGroupName, networkDeviceName); + } + + public List getDynamicInterfaceMaps(Context context) { + return serviceManager.networkDevices().getDynamicInterfaceMaps(resourceGroupName, networkDeviceName, context); + } + + public NetworkDeviceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkDeviceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkDeviceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NetworkDeviceImpl withNetworkDeviceSku(String networkDeviceSku) { + this.innerModel().withNetworkDeviceSku(networkDeviceSku); + return this; + } + + public NetworkDeviceImpl withNetworkDeviceRole(NetworkDeviceRoleTypes networkDeviceRole) { + this.innerModel().withNetworkDeviceRole(networkDeviceRole); + return this; + } + + public NetworkDeviceImpl withHostname(String hostname) { + if (isInCreateMode()) { + this.innerModel().withHostname(hostname); + return this; + } else { + this.updateBody.withHostname(hostname); + return this; + } + } + + public NetworkDeviceImpl withSerialNumber(String serialNumber) { + if (isInCreateMode()) { + this.innerModel().withSerialNumber(serialNumber); + return this; + } else { + this.updateBody.withSerialNumber(serialNumber); + return this; + } + } + + public NetworkDeviceImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java new file mode 100644 index 000000000000..a44b2d14194f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.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.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSku; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesInterfacesItem; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkuPropertiesSupportedVersionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class NetworkDeviceSkuImpl implements NetworkDeviceSku { + private NetworkDeviceSkuInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + NetworkDeviceSkuImpl( + NetworkDeviceSkuInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String model() { + return this.innerModel().model(); + } + + public String manufacturer() { + return this.innerModel().manufacturer(); + } + + public List supportedVersions() { + List inner = this.innerModel().supportedVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkDeviceSkuPropertiesLimits limits() { + return this.innerModel().limits(); + } + + public List supportedRoleTypes() { + List inner = this.innerModel().supportedRoleTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List interfaces() { + List inner = this.innerModel().interfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkDeviceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusClientImpl.java new file mode 100644 index 000000000000..e0de1f54158d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusClientImpl.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.resourcemanager.managednetworkfabric.fluent.NetworkDeviceSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkusListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkDeviceSkusClient. */ +public final class NetworkDeviceSkusClientImpl implements NetworkDeviceSkusClient { + /** The proxy service used to perform REST calls. */ + private final NetworkDeviceSkusService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkDeviceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkDeviceSkusClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkDeviceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkDeviceSkus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkDeviceSkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceSkuName") String networkDeviceSkuName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Device SKU details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkDeviceSkuName) { + 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 (networkDeviceSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceSkuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + networkDeviceSkuName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Device SKU details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkDeviceSkuName, 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 (networkDeviceSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceSkuName 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(), + this.client.getApiVersion(), + networkDeviceSkuName, + accept, + context); + } + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Device SKU details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String networkDeviceSkuName) { + return getWithResponseAsync(networkDeviceSkuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Device SKU details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String networkDeviceSkuName, Context context) { + return getWithResponseAsync(networkDeviceSkuName, context).block(); + } + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Device SKU details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceSkuInner get(String networkDeviceSkuName) { + return getWithResponse(networkDeviceSkuName, Context.NONE).getValue(); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus 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 URL to get the next list of items + *

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 NetworkDeviceSkus 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 URL to get the next list of items + *

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 NetworkDeviceSkus 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusImpl.java new file mode 100644 index 000000000000..21879aa9099a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.NetworkDeviceSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSku; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSkus; + +public final class NetworkDeviceSkusImpl implements NetworkDeviceSkus { + private static final ClientLogger LOGGER = new ClientLogger(NetworkDeviceSkusImpl.class); + + private final NetworkDeviceSkusClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkDeviceSkusImpl( + NetworkDeviceSkusClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String networkDeviceSkuName, Context context) { + Response inner = this.serviceClient().getWithResponse(networkDeviceSkuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkDeviceSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkDeviceSku get(String networkDeviceSkuName) { + NetworkDeviceSkuInner inner = this.serviceClient().get(networkDeviceSkuName); + if (inner != null) { + return new NetworkDeviceSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceSkuImpl(inner1, this.manager())); + } + + private NetworkDeviceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesClientImpl.java new file mode 100644 index 000000000000..1ef65d4f4070 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesClientImpl.java @@ -0,0 +1,3941 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkDevicesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicePatchParameters; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevicesListResult; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; +import com.fasterxml.jackson.core.type.TypeReference; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkDevicesClient. */ +public final class NetworkDevicesClientImpl implements NetworkDevicesClient { + /** The proxy service used to perform REST calls. */ + private final NetworkDevicesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkDevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkDevicesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkDevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkDevices to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkDevicesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @BodyParam("application/json") NetworkDeviceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}") + @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("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @BodyParam("application/json") NetworkDevicePatchParameters body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}") + @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("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDevices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/reboot") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reboot( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/restoreConfig") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restoreConfig( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updateVersion") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateVersion( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @BodyParam("application/json") UpdateVersionProperties body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/generateSupportPackage") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateSupportPackage( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/updatePowerCycle") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePowerCycle( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @BodyParam("application/json") UpdatePowerCycleProperties body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getStatus") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getStaticInterfaceMaps") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getStaticInterfaceMaps( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/getDynamicInterfaceMaps") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getDynamicInterfaceMaps( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @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); + + @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); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkDeviceInner> beginCreateAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, networkDeviceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkDeviceInner.class, + NetworkDeviceInner.class, + this.client.getContext()); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkDeviceInner> beginCreateAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkDeviceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkDeviceInner.class, NetworkDeviceInner.class, context); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkDeviceInner> beginCreate( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body) { + return this.beginCreateAsync(resourceGroupName, networkDeviceName, body).getSyncPoller(); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkDeviceInner> beginCreate( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, networkDeviceName, body, context).getSyncPoller(); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body) { + return beginCreateAsync(resourceGroupName, networkDeviceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context) { + return beginCreateAsync(resourceGroupName, networkDeviceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceInner create(String resourceGroupName, String networkDeviceName, NetworkDeviceInner body) { + return createAsync(resourceGroupName, networkDeviceName, body).block(); + } + + /** + * Create Network Device. + * + *

Create a Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceInner create( + String resourceGroupName, String networkDeviceName, NetworkDeviceInner body, Context context) { + return createAsync(resourceGroupName, networkDeviceName, body, context).block(); + } + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName 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(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName 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(), + networkDeviceName, + accept, + context); + } + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkDeviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkDeviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkDeviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceInner getByResourceGroup(String resourceGroupName, String networkDeviceName) { + return getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, Context.NONE).getValue(); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkDeviceInner> beginUpdateAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, networkDeviceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkDeviceInner.class, + NetworkDeviceInner.class, + this.client.getContext()); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkDeviceInner> beginUpdateAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkDeviceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkDeviceInner.class, NetworkDeviceInner.class, context); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkDeviceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body) { + return this.beginUpdateAsync(resourceGroupName, networkDeviceName, body).getSyncPoller(); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkDeviceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context) { + return this.beginUpdateAsync(resourceGroupName, networkDeviceName, body, context).getSyncPoller(); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body) { + return beginUpdateAsync(resourceGroupName, networkDeviceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context) { + return beginUpdateAsync(resourceGroupName, networkDeviceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceInner update( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body) { + return updateAsync(resourceGroupName, networkDeviceName, body).block(); + } + + /** + * Updates a Network Device. + * + *

Update certain properties of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param body Network Device properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkDevice resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkDeviceInner update( + String resourceGroupName, String networkDeviceName, NetworkDevicePatchParameters body, Context context) { + return updateAsync(resourceGroupName, networkDeviceName, body, context).block(); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName 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(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName 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(), + networkDeviceName, + accept, + context); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName) { + return this.beginDeleteAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkDeviceName) { + return beginDeleteAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkDeviceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkDeviceName) { + deleteAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkDeviceName, Context context) { + deleteAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices 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())); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices 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)); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices 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)); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> rebootWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reboot( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> rebootWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reboot( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRebootAsync(String resourceGroupName, String networkDeviceName) { + Mono>> mono = rebootWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRebootAsync( + String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = rebootWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginReboot(String resourceGroupName, String networkDeviceName) { + return this.beginRebootAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginReboot( + String resourceGroupName, String networkDeviceName, Context context) { + return this.beginRebootAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rebootAsync(String resourceGroupName, String networkDeviceName) { + return beginRebootAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 rebootAsync(String resourceGroupName, String networkDeviceName, Context context) { + return beginRebootAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reboot(String resourceGroupName, String networkDeviceName) { + rebootAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reboot(String resourceGroupName, String networkDeviceName, Context context) { + rebootAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restoreConfigWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restoreConfig( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restoreConfigWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restoreConfig( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestoreConfigAsync( + String resourceGroupName, String networkDeviceName) { + Mono>> mono = restoreConfigWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestoreConfigAsync( + String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restoreConfigWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestoreConfig(String resourceGroupName, String networkDeviceName) { + return this.beginRestoreConfigAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestoreConfig( + String resourceGroupName, String networkDeviceName, Context context) { + return this.beginRestoreConfigAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restoreConfigAsync(String resourceGroupName, String networkDeviceName) { + return beginRestoreConfigAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restoreConfigAsync(String resourceGroupName, String networkDeviceName, Context context) { + return beginRestoreConfigAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restoreConfig(String resourceGroupName, String networkDeviceName) { + restoreConfigAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restoreConfig(String resourceGroupName, String networkDeviceName, Context context) { + restoreConfigAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateVersionWithResponseAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateVersion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateVersionWithResponseAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateVersion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateVersionAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + Mono>> mono = + updateVersionWithResponseAsync(resourceGroupName, networkDeviceName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateVersionAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateVersionWithResponseAsync(resourceGroupName, networkDeviceName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + return this.beginUpdateVersionAsync(resourceGroupName, networkDeviceName, body).getSyncPoller(); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context) { + return this.beginUpdateVersionAsync(resourceGroupName, networkDeviceName, body, context).getSyncPoller(); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateVersionAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + return beginUpdateVersionAsync(resourceGroupName, networkDeviceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateVersionAsync( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context) { + return beginUpdateVersionAsync(resourceGroupName, networkDeviceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateVersion(String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + updateVersionAsync(resourceGroupName, networkDeviceName, body).block(); + } + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context) { + updateVersionAsync(resourceGroupName, networkDeviceName, body, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateSupportPackageWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateSupportPackage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateSupportPackageWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateSupportPackage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SupportPackagePropertiesInner> + beginGenerateSupportPackageAsync(String resourceGroupName, String networkDeviceName) { + Mono>> mono = + generateSupportPackageWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SupportPackagePropertiesInner.class, + SupportPackagePropertiesInner.class, + this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SupportPackagePropertiesInner> + beginGenerateSupportPackageAsync(String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateSupportPackageWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SupportPackagePropertiesInner.class, + SupportPackagePropertiesInner.class, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportPackagePropertiesInner> + beginGenerateSupportPackage(String resourceGroupName, String networkDeviceName) { + return this.beginGenerateSupportPackageAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportPackagePropertiesInner> + beginGenerateSupportPackage(String resourceGroupName, String networkDeviceName, Context context) { + return this.beginGenerateSupportPackageAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSupportPackageAsync( + String resourceGroupName, String networkDeviceName) { + return beginGenerateSupportPackageAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSupportPackageAsync( + String resourceGroupName, String networkDeviceName, Context context) { + return beginGenerateSupportPackageAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportPackagePropertiesInner generateSupportPackage(String resourceGroupName, String networkDeviceName) { + return generateSupportPackageAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportPackagePropertiesInner generateSupportPackage( + String resourceGroupName, String networkDeviceName, Context context) { + return generateSupportPackageAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updatePowerCycleWithResponseAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePowerCycle( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updatePowerCycleWithResponseAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePowerCycle( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + body, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdatePowerCycleAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + Mono>> mono = + updatePowerCycleWithResponseAsync(resourceGroupName, networkDeviceName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdatePowerCycleAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePowerCycleWithResponseAsync(resourceGroupName, networkDeviceName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + return this.beginUpdatePowerCycleAsync(resourceGroupName, networkDeviceName, body).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context) { + return this.beginUpdatePowerCycleAsync(resourceGroupName, networkDeviceName, body, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updatePowerCycleAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + return beginUpdatePowerCycleAsync(resourceGroupName, networkDeviceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updatePowerCycleAsync( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context) { + return beginUpdatePowerCycleAsync(resourceGroupName, networkDeviceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updatePowerCycle(String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + updatePowerCycleAsync(resourceGroupName, networkDeviceName, body).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context) { + updatePowerCycleAsync(resourceGroupName, networkDeviceName, body, context).block(); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GetDeviceStatusPropertiesInner> beginGetStatusAsync( + String resourceGroupName, String networkDeviceName) { + Mono>> mono = getStatusWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GetDeviceStatusPropertiesInner.class, + GetDeviceStatusPropertiesInner.class, + this.client.getContext()); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GetDeviceStatusPropertiesInner> beginGetStatusAsync( + String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getStatusWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GetDeviceStatusPropertiesInner.class, + GetDeviceStatusPropertiesInner.class, + context); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GetDeviceStatusPropertiesInner> beginGetStatus( + String resourceGroupName, String networkDeviceName) { + return this.beginGetStatusAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GetDeviceStatusPropertiesInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, Context context) { + return this.beginGetStatusAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync(String resourceGroupName, String networkDeviceName) { + return beginGetStatusAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync( + String resourceGroupName, String networkDeviceName, Context context) { + return beginGetStatusAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetDeviceStatusPropertiesInner getStatus(String resourceGroupName, String networkDeviceName) { + return getStatusAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetDeviceStatusPropertiesInner getStatus( + String resourceGroupName, String networkDeviceName, Context context) { + return getStatusAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStaticInterfaceMapsWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStaticInterfaceMaps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStaticInterfaceMapsWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStaticInterfaceMaps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult>, + List> + beginGetStaticInterfaceMapsAsync(String resourceGroupName, String networkDeviceName) { + Mono>> mono = + getStaticInterfaceMapsWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + ., List> + getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + this.client.getContext()); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult>, + List> + beginGetStaticInterfaceMapsAsync(String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getStaticInterfaceMapsWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + ., List> + getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + context); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult>, + List> + beginGetStaticInterfaceMaps(String resourceGroupName, String networkDeviceName) { + return this.beginGetStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult>, + List> + beginGetStaticInterfaceMaps(String resourceGroupName, String networkDeviceName, Context context) { + return this.beginGetStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStaticInterfaceMapsAsync( + String resourceGroupName, String networkDeviceName) { + return beginGetStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStaticInterfaceMapsAsync( + String resourceGroupName, String networkDeviceName, Context context) { + return beginGetStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName) { + return getStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context) { + return getStaticInterfaceMapsAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getDynamicInterfaceMapsWithResponseAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDynamicInterfaceMaps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getDynamicInterfaceMapsWithResponseAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDynamicInterfaceMaps( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult>, + List> + beginGetDynamicInterfaceMapsAsync(String resourceGroupName, String networkDeviceName) { + Mono>> mono = + getDynamicInterfaceMapsWithResponseAsync(resourceGroupName, networkDeviceName); + return this + .client + ., List> + getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult>, + List> + beginGetDynamicInterfaceMapsAsync(String resourceGroupName, String networkDeviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getDynamicInterfaceMapsWithResponseAsync(resourceGroupName, networkDeviceName, context); + return this + .client + ., List> + getLroResult( + mono, + this.client.getHttpPipeline(), + new TypeReference>() { + }.getType(), + new TypeReference>() { + }.getType(), + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult>, + List> + beginGetDynamicInterfaceMaps(String resourceGroupName, String networkDeviceName) { + return this.beginGetDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult>, + List> + beginGetDynamicInterfaceMaps(String resourceGroupName, String networkDeviceName, Context context) { + return this.beginGetDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDynamicInterfaceMapsAsync( + String resourceGroupName, String networkDeviceName) { + return beginGetDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDynamicInterfaceMapsAsync( + String resourceGroupName, String networkDeviceName, Context context) { + return beginGetDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName) { + return getDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context) { + return getDynamicInterfaceMapsAsync(resourceGroupName, networkDeviceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkDevices 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 URL to get the next list of items + *

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 NetworkDevices 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkDevices 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 URL to get the next list of items + *

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 NetworkDevices 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesImpl.java new file mode 100644 index 000000000000..394ded5076c4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesImpl.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.NetworkDevicesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.GetDeviceStatusProperties; +import com.azure.resourcemanager.managednetworkfabric.models.GetDynamicInterfaceMapsPropertiesItem; +import com.azure.resourcemanager.managednetworkfabric.models.GetStaticInterfaceMapsPropertiesItem; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevices; +import com.azure.resourcemanager.managednetworkfabric.models.SupportPackageProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkDevicesImpl implements NetworkDevices { + private static final ClientLogger LOGGER = new ClientLogger(NetworkDevicesImpl.class); + + private final NetworkDevicesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkDevicesImpl( + NetworkDevicesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkDeviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkDeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkDevice getByResourceGroup(String resourceGroupName, String networkDeviceName) { + NetworkDeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkDeviceName); + if (inner != null) { + return new NetworkDeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkDeviceName) { + this.serviceClient().delete(resourceGroupName, networkDeviceName); + } + + public void delete(String resourceGroupName, String networkDeviceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkDeviceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkDeviceImpl(inner1, this.manager())); + } + + public void reboot(String resourceGroupName, String networkDeviceName) { + this.serviceClient().reboot(resourceGroupName, networkDeviceName); + } + + public void reboot(String resourceGroupName, String networkDeviceName, Context context) { + this.serviceClient().reboot(resourceGroupName, networkDeviceName, context); + } + + public void restoreConfig(String resourceGroupName, String networkDeviceName) { + this.serviceClient().restoreConfig(resourceGroupName, networkDeviceName); + } + + public void restoreConfig(String resourceGroupName, String networkDeviceName, Context context) { + this.serviceClient().restoreConfig(resourceGroupName, networkDeviceName, context); + } + + public void updateVersion(String resourceGroupName, String networkDeviceName, UpdateVersionProperties body) { + this.serviceClient().updateVersion(resourceGroupName, networkDeviceName, body); + } + + public void updateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context) { + this.serviceClient().updateVersion(resourceGroupName, networkDeviceName, body, context); + } + + public SupportPackageProperties generateSupportPackage(String resourceGroupName, String networkDeviceName) { + SupportPackagePropertiesInner inner = + this.serviceClient().generateSupportPackage(resourceGroupName, networkDeviceName); + if (inner != null) { + return new SupportPackagePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public SupportPackageProperties generateSupportPackage( + String resourceGroupName, String networkDeviceName, Context context) { + SupportPackagePropertiesInner inner = + this.serviceClient().generateSupportPackage(resourceGroupName, networkDeviceName, context); + if (inner != null) { + return new SupportPackagePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public void updatePowerCycle(String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body) { + this.serviceClient().updatePowerCycle(resourceGroupName, networkDeviceName, body); + } + + public void updatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context) { + this.serviceClient().updatePowerCycle(resourceGroupName, networkDeviceName, body, context); + } + + public GetDeviceStatusProperties getStatus(String resourceGroupName, String networkDeviceName) { + GetDeviceStatusPropertiesInner inner = this.serviceClient().getStatus(resourceGroupName, networkDeviceName); + if (inner != null) { + return new GetDeviceStatusPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public GetDeviceStatusProperties getStatus(String resourceGroupName, String networkDeviceName, Context context) { + GetDeviceStatusPropertiesInner inner = + this.serviceClient().getStatus(resourceGroupName, networkDeviceName, context); + if (inner != null) { + return new GetDeviceStatusPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName) { + List inner = + this.serviceClient().getStaticInterfaceMaps(resourceGroupName, networkDeviceName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetStaticInterfaceMapsPropertiesItemImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context) { + List inner = + this.serviceClient().getStaticInterfaceMaps(resourceGroupName, networkDeviceName, context); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetStaticInterfaceMapsPropertiesItemImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName) { + List inner = + this.serviceClient().getDynamicInterfaceMaps(resourceGroupName, networkDeviceName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetDynamicInterfaceMapsPropertiesItemImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context) { + List inner = + this.serviceClient().getDynamicInterfaceMaps(resourceGroupName, networkDeviceName, context); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetDynamicInterfaceMapsPropertiesItemImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public NetworkDevice 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkDeviceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + this.delete(resourceGroupName, networkDeviceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + this.delete(resourceGroupName, networkDeviceName, context); + } + + private NetworkDevicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkDeviceImpl define(String name) { + return new NetworkDeviceImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllerImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllerImpl.java new file mode 100644 index 000000000000..fe4a0c405cc4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllerImpl.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricController; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPatch; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesInfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesManagedResourceGroupConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesWorkloadServices; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkFabricControllerImpl + implements NetworkFabricController, NetworkFabricController.Definition, NetworkFabricController.Update { + private NetworkFabricControllerInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkFabricControllerPropertiesInfrastructureServices infrastructureServices() { + return this.innerModel().infrastructureServices(); + } + + public NetworkFabricControllerPropertiesWorkloadServices workloadServices() { + return this.innerModel().workloadServices(); + } + + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public List networkFabricIds() { + List inner = this.innerModel().networkFabricIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean workloadManagementNetwork() { + return this.innerModel().workloadManagementNetwork(); + } + + public String ipv4AddressSpace() { + return this.innerModel().ipv4AddressSpace(); + } + + public String ipv6AddressSpace() { + return this.innerModel().ipv6AddressSpace(); + } + + public NetworkFabricControllerOperationalState operationalState() { + return this.innerModel().operationalState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List infrastructureExpressRouteConnections() { + List inner = this.innerModel().infrastructureExpressRouteConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List workloadExpressRouteConnections() { + List inner = this.innerModel().workloadExpressRouteConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkFabricControllerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkFabricControllerName; + + private NetworkFabricControllerPatch updateBody; + + public NetworkFabricControllerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFabricController create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .create(resourceGroupName, networkFabricControllerName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFabricController create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .create(resourceGroupName, networkFabricControllerName, this.innerModel(), context); + return this; + } + + NetworkFabricControllerImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkFabricControllerInner(); + this.serviceManager = serviceManager; + this.networkFabricControllerName = name; + } + + public NetworkFabricControllerImpl update() { + this.updateBody = new NetworkFabricControllerPatch(); + return this; + } + + public NetworkFabricController apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .update(resourceGroupName, networkFabricControllerName, updateBody, Context.NONE); + return this; + } + + public NetworkFabricController apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .update(resourceGroupName, networkFabricControllerName, updateBody, context); + return this; + } + + NetworkFabricControllerImpl( + NetworkFabricControllerInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkFabricControllerName = Utils.getValueFromIdByName(innerObject.id(), "networkFabricControllers"); + } + + public NetworkFabricController refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, Context.NONE) + .getValue(); + return this; + } + + public NetworkFabricController refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabricControllers() + .getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, context) + .getValue(); + return this; + } + + public void enableWorkloadManagementNetwork() { + serviceManager + .networkFabricControllers() + .enableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName); + } + + public void enableWorkloadManagementNetwork(Context context) { + serviceManager + .networkFabricControllers() + .enableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName, context); + } + + public void disableWorkloadManagementNetwork() { + serviceManager + .networkFabricControllers() + .disableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName); + } + + public void disableWorkloadManagementNetwork(Context context) { + serviceManager + .networkFabricControllers() + .disableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName, context); + } + + public NetworkFabricControllerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFabricControllerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFabricControllerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NetworkFabricControllerImpl withManagedResourceGroupConfiguration( + NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + public NetworkFabricControllerImpl withIpv4AddressSpace(String ipv4AddressSpace) { + this.innerModel().withIpv4AddressSpace(ipv4AddressSpace); + return this; + } + + public NetworkFabricControllerImpl withIpv6AddressSpace(String ipv6AddressSpace) { + this.innerModel().withIpv6AddressSpace(ipv6AddressSpace); + return this; + } + + public NetworkFabricControllerImpl withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections) { + if (isInCreateMode()) { + this.innerModel().withInfrastructureExpressRouteConnections(infrastructureExpressRouteConnections); + return this; + } else { + this.updateBody.withInfrastructureExpressRouteConnections(infrastructureExpressRouteConnections); + return this; + } + } + + public NetworkFabricControllerImpl withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections) { + if (isInCreateMode()) { + this.innerModel().withWorkloadExpressRouteConnections(workloadExpressRouteConnections); + return this; + } else { + this.updateBody.withWorkloadExpressRouteConnections(workloadExpressRouteConnections); + return this; + } + } + + public NetworkFabricControllerImpl withAnnotation(String annotation) { + this.innerModel().withAnnotation(annotation); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersClientImpl.java new file mode 100644 index 000000000000..a2c58e55b2fd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersClientImpl.java @@ -0,0 +1,2272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkFabricControllersClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPatch; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllersListResult; +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 NetworkFabricControllersClient. */ +public final class NetworkFabricControllersClientImpl implements NetworkFabricControllersClient { + /** The proxy service used to perform REST calls. */ + private final NetworkFabricControllersService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkFabricControllersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFabricControllersClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy + .create(NetworkFabricControllersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkFabricControllers to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkFabricControllersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricControllerName") String networkFabricControllerName, + @BodyParam("application/json") NetworkFabricControllerInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}") + @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("networkFabricControllerName") String networkFabricControllerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricControllerName") String networkFabricControllerName, + @BodyParam("application/json") NetworkFabricControllerPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}") + @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("networkFabricControllerName") String networkFabricControllerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}/enableWorkloadManagementNetwork") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableWorkloadManagementNetwork( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricControllerName") String networkFabricControllerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName}/disableWorkloadManagementNetwork") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableWorkloadManagementNetwork( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricControllerName") String networkFabricControllerName, + @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); + + @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); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + body, + accept, + context); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricControllerInner> beginCreateAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkFabricControllerName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricControllerInner.class, + NetworkFabricControllerInner.class, + this.client.getContext()); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricControllerInner> beginCreateAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkFabricControllerName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricControllerInner.class, + NetworkFabricControllerInner.class, + context); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricControllerInner> beginCreate( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body) { + return this.beginCreateAsync(resourceGroupName, networkFabricControllerName, body).getSyncPoller(); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricControllerInner> beginCreate( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context) { + return this.beginCreateAsync(resourceGroupName, networkFabricControllerName, body, context).getSyncPoller(); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body) { + return beginCreateAsync(resourceGroupName, networkFabricControllerName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context) { + return beginCreateAsync(resourceGroupName, networkFabricControllerName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricControllerInner create( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerInner body) { + return createAsync(resourceGroupName, networkFabricControllerName, body).block(); + } + + /** + * Create Network fabric controller. + * + *

Creates a Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricControllerInner create( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerInner body, + Context context) { + return createAsync(resourceGroupName, networkFabricControllerName, body, context).block(); + } + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFabricControllerName) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName 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(), + networkFabricControllerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFabricControllerName, 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName 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(), + networkFabricControllerName, + accept, + context); + } + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkFabricControllerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFabricControllerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricControllerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFabricControllerName, context).block(); + } + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricControllerInner getByResourceGroup( + String resourceGroupName, String networkFabricControllerName) { + return getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, Context.NONE).getValue(); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + body, + accept, + context); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricControllerInner> beginUpdateAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkFabricControllerName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricControllerInner.class, + NetworkFabricControllerInner.class, + this.client.getContext()); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricControllerInner> beginUpdateAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkFabricControllerName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricControllerInner.class, + NetworkFabricControllerInner.class, + context); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricControllerInner> beginUpdate( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body) { + return this.beginUpdateAsync(resourceGroupName, networkFabricControllerName, body).getSyncPoller(); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricControllerInner> beginUpdate( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context) { + return this.beginUpdateAsync(resourceGroupName, networkFabricControllerName, body, context).getSyncPoller(); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body) { + return beginUpdateAsync(resourceGroupName, networkFabricControllerName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, networkFabricControllerName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricControllerInner update( + String resourceGroupName, String networkFabricControllerName, NetworkFabricControllerPatch body) { + return updateAsync(resourceGroupName, networkFabricControllerName, body).block(); + } + + /** + * Updates a Network Fabric Controller. + * + *

Updates are currently not supported for the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param body Network Fabric Controller properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricControllerInner update( + String resourceGroupName, + String networkFabricControllerName, + NetworkFabricControllerPatch body, + Context context) { + return updateAsync(resourceGroupName, networkFabricControllerName, body, context).block(); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName 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(), + networkFabricControllerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName, 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName 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(), + networkFabricControllerName, + accept, + context); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkFabricControllerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkFabricControllerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName) { + return this.beginDeleteAsync(resourceGroupName, networkFabricControllerName).getSyncPoller(); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricControllerName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkFabricControllerName, context).getSyncPoller(); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricControllerName) { + return beginDeleteAsync(resourceGroupName, networkFabricControllerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricControllerName, Context context) { + return beginDeleteAsync(resourceGroupName, networkFabricControllerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricControllerName) { + deleteAsync(resourceGroupName, networkFabricControllerName).block(); + } + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricControllerName, Context context) { + deleteAsync(resourceGroupName, networkFabricControllerName, context).block(); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers 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())); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers 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)); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers 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)); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> enableWorkloadManagementNetworkWithResponseAsync( + String resourceGroupName, String networkFabricControllerName) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableWorkloadManagementNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> enableWorkloadManagementNetworkWithResponseAsync( + String resourceGroupName, String networkFabricControllerName, 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableWorkloadManagementNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName) { + Mono>> mono = + enableWorkloadManagementNetworkWithResponseAsync(resourceGroupName, networkFabricControllerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableWorkloadManagementNetworkWithResponseAsync(resourceGroupName, networkFabricControllerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName) { + return this + .beginEnableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + return this + .beginEnableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 enableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName) { + return beginEnableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 enableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName, Context context) { + return beginEnableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName) { + enableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + enableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disableWorkloadManagementNetworkWithResponseAsync( + String resourceGroupName, String networkFabricControllerName) { + 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableWorkloadManagementNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disableWorkloadManagementNetworkWithResponseAsync( + String resourceGroupName, String networkFabricControllerName, 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 (networkFabricControllerName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkFabricControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableWorkloadManagementNetwork( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricControllerName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName) { + Mono>> mono = + disableWorkloadManagementNetworkWithResponseAsync(resourceGroupName, networkFabricControllerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableWorkloadManagementNetworkWithResponseAsync(resourceGroupName, networkFabricControllerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName) { + return this + .beginDisableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + return this + .beginDisableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName) { + return beginDisableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disableWorkloadManagementNetworkAsync( + String resourceGroupName, String networkFabricControllerName, Context context) { + return beginDisableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName) { + disableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + disableWorkloadManagementNetworkAsync(resourceGroupName, networkFabricControllerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkFabricControllers 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 URL to get the next list of items + *

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 NetworkFabricControllers 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkFabricControllers 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 URL to get the next list of items + *

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 NetworkFabricControllers 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersImpl.java new file mode 100644 index 000000000000..d8e067b319ca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.NetworkFabricControllersClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricController; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllers; + +public final class NetworkFabricControllersImpl implements NetworkFabricControllers { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFabricControllersImpl.class); + + private final NetworkFabricControllersClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkFabricControllersImpl( + NetworkFabricControllersClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricControllerName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFabricControllerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFabricController getByResourceGroup(String resourceGroupName, String networkFabricControllerName) { + NetworkFabricControllerInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkFabricControllerName); + if (inner != null) { + return new NetworkFabricControllerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkFabricControllerName) { + this.serviceClient().delete(resourceGroupName, networkFabricControllerName); + } + + public void delete(String resourceGroupName, String networkFabricControllerName, Context context) { + this.serviceClient().delete(resourceGroupName, networkFabricControllerName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkFabricControllerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFabricControllerImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkFabricControllerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkFabricControllerImpl(inner1, this.manager())); + } + + public void enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName) { + this.serviceClient().enableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName); + } + + public void enableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + this.serviceClient().enableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName, context); + } + + public void disableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName) { + this.serviceClient().disableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName); + } + + public void disableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context) { + this.serviceClient().disableWorkloadManagementNetwork(resourceGroupName, networkFabricControllerName, context); + } + + public NetworkFabricController 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 networkFabricControllerName = Utils.getValueFromIdByName(id, "networkFabricControllers"); + if (networkFabricControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFabricControllers'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, 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 networkFabricControllerName = Utils.getValueFromIdByName(id, "networkFabricControllers"); + if (networkFabricControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFabricControllers'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkFabricControllerName, 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 networkFabricControllerName = Utils.getValueFromIdByName(id, "networkFabricControllers"); + if (networkFabricControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFabricControllers'.", + id))); + } + this.delete(resourceGroupName, networkFabricControllerName, 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 networkFabricControllerName = Utils.getValueFromIdByName(id, "networkFabricControllers"); + if (networkFabricControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkFabricControllers'.", + id))); + } + this.delete(resourceGroupName, networkFabricControllerName, context); + } + + private NetworkFabricControllersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkFabricControllerImpl define(String name) { + return new NetworkFabricControllerImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java new file mode 100644 index 000000000000..4dd9cbea758b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPatchParameters; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesTerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchParametersTerminalServerConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkFabricImpl implements NetworkFabric, NetworkFabric.Definition, NetworkFabric.Update { + private NetworkFabricInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkFabricSku() { + return this.innerModel().networkFabricSku(); + } + + public int rackCount() { + return this.innerModel().rackCount(); + } + + public int serverCountPerRack() { + return this.innerModel().serverCountPerRack(); + } + + public String ipv4Prefix() { + return this.innerModel().ipv4Prefix(); + } + + public String ipv6Prefix() { + return this.innerModel().ipv6Prefix(); + } + + public String routerId() { + return this.innerModel().routerId(); + } + + public int fabricAsn() { + return this.innerModel().fabricAsn(); + } + + public String networkFabricControllerId() { + return this.innerModel().networkFabricControllerId(); + } + + public NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration() { + return this.innerModel().terminalServerConfiguration(); + } + + public NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration() { + return this.innerModel().managementNetworkConfiguration(); + } + + public NetworkFabricOperationalState operationalState() { + return this.innerModel().operationalState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List racks() { + List inner = this.innerModel().racks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List l2IsolationDomains() { + List inner = this.innerModel().l2IsolationDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List l3IsolationDomains() { + List inner = this.innerModel().l3IsolationDomains(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkFabricInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkFabricName; + + private NetworkFabricPatchParameters updateBody; + + public NetworkFabricImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFabric create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .create(resourceGroupName, networkFabricName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFabric create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .create(resourceGroupName, networkFabricName, this.innerModel(), context); + return this; + } + + NetworkFabricImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkFabricInner(); + this.serviceManager = serviceManager; + this.networkFabricName = name; + } + + public NetworkFabricImpl update() { + this.updateBody = new NetworkFabricPatchParameters(); + return this; + } + + public NetworkFabric apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .update(resourceGroupName, networkFabricName, updateBody, Context.NONE); + return this; + } + + public NetworkFabric apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .update(resourceGroupName, networkFabricName, updateBody, context); + return this; + } + + NetworkFabricImpl( + NetworkFabricInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkFabricName = Utils.getValueFromIdByName(innerObject.id(), "networkFabrics"); + } + + public NetworkFabric refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .getByResourceGroupWithResponse(resourceGroupName, networkFabricName, Context.NONE) + .getValue(); + return this; + } + + public NetworkFabric refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkFabrics() + .getByResourceGroupWithResponse(resourceGroupName, networkFabricName, context) + .getValue(); + return this; + } + + public void provision() { + serviceManager.networkFabrics().provision(resourceGroupName, networkFabricName); + } + + public void provision(Context context) { + serviceManager.networkFabrics().provision(resourceGroupName, networkFabricName, context); + } + + public void deprovision() { + serviceManager.networkFabrics().deprovision(resourceGroupName, networkFabricName); + } + + public void deprovision(Context context) { + serviceManager.networkFabrics().deprovision(resourceGroupName, networkFabricName, context); + } + + public NetworkFabricImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFabricImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFabricImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NetworkFabricImpl withNetworkFabricSku(String networkFabricSku) { + this.innerModel().withNetworkFabricSku(networkFabricSku); + return this; + } + + public NetworkFabricImpl withRackCount(int rackCount) { + this.innerModel().withRackCount(rackCount); + return this; + } + + public NetworkFabricImpl withServerCountPerRack(int serverCountPerRack) { + this.innerModel().withServerCountPerRack(serverCountPerRack); + return this; + } + + public NetworkFabricImpl withIpv4Prefix(String ipv4Prefix) { + this.innerModel().withIpv4Prefix(ipv4Prefix); + return this; + } + + public NetworkFabricImpl withIpv6Prefix(String ipv6Prefix) { + this.innerModel().withIpv6Prefix(ipv6Prefix); + return this; + } + + public NetworkFabricImpl withFabricAsn(int fabricAsn) { + this.innerModel().withFabricAsn(fabricAsn); + return this; + } + + public NetworkFabricImpl withNetworkFabricControllerId(String networkFabricControllerId) { + this.innerModel().withNetworkFabricControllerId(networkFabricControllerId); + return this; + } + + public NetworkFabricImpl withTerminalServerConfiguration( + NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration) { + this.innerModel().withTerminalServerConfiguration(terminalServerConfiguration); + return this; + } + + public NetworkFabricImpl withManagementNetworkConfiguration( + NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration) { + this.innerModel().withManagementNetworkConfiguration(managementNetworkConfiguration); + return this; + } + + public NetworkFabricImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + public NetworkFabricImpl withTerminalServerConfiguration( + TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration) { + this.updateBody.withTerminalServerConfiguration(terminalServerConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java new file mode 100644 index 000000000000..ab25c2ef4905 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSku; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; + +public final class NetworkFabricSkuImpl implements NetworkFabricSku { + private NetworkFabricSkuInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + NetworkFabricSkuImpl( + NetworkFabricSkuInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public Integer maxComputeRacks() { + return this.innerModel().maxComputeRacks(); + } + + public String minSupportedVer() { + return this.innerModel().minSupportedVer(); + } + + public String maxSupportedVer() { + return this.innerModel().maxSupportedVer(); + } + + public String detailsUri() { + return this.innerModel().detailsUri(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkFabricSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusClientImpl.java new file mode 100644 index 000000000000..ba9706b94a50 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusClientImpl.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.resourcemanager.managednetworkfabric.fluent.NetworkFabricSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSkusListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkFabricSkusClient. */ +public final class NetworkFabricSkusClientImpl implements NetworkFabricSkusClient { + /** The proxy service used to perform REST calls. */ + private final NetworkFabricSkusService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkFabricSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFabricSkusClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkFabricSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkFabricSkus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkFabricSkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricSkuName") String networkFabricSkuName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkFabricSkuName) { + 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 (networkFabricSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricSkuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + networkFabricSkuName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkFabricSkuName, 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 (networkFabricSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricSkuName 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(), + this.client.getApiVersion(), + networkFabricSkuName, + accept, + context); + } + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String networkFabricSkuName) { + return getWithResponseAsync(networkFabricSkuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String networkFabricSkuName, Context context) { + return getWithResponseAsync(networkFabricSkuName, context).block(); + } + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricSkuInner get(String networkFabricSkuName) { + return getWithResponse(networkFabricSkuName, Context.NONE).getValue(); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @throws 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 NetworkFabricSkus 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkFabricSkus 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @throws 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 NetworkFabricSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkFabricSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @throws 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 NetworkFabricSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkFabricSkus 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 URL to get the next list of items + *

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 NetworkFabricSkus 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 URL to get the next list of items + *

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 NetworkFabricSkus 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusImpl.java new file mode 100644 index 000000000000..2a319f52f688 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.NetworkFabricSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSku; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricSkus; + +public final class NetworkFabricSkusImpl implements NetworkFabricSkus { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFabricSkusImpl.class); + + private final NetworkFabricSkusClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkFabricSkusImpl( + NetworkFabricSkusClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String networkFabricSkuName, Context context) { + Response inner = this.serviceClient().getWithResponse(networkFabricSkuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFabricSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFabricSku get(String networkFabricSkuName) { + NetworkFabricSkuInner inner = this.serviceClient().get(networkFabricSkuName); + if (inner != null) { + return new NetworkFabricSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkFabricSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkFabricSkuImpl(inner1, this.manager())); + } + + private NetworkFabricSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java new file mode 100644 index 000000000000..71b01910401b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java @@ -0,0 +1,2170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkFabricsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPatchParameters; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricsListResult; +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 NetworkFabricsClient. */ +public final class NetworkFabricsClientImpl implements NetworkFabricsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkFabricsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkFabricsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFabricsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkFabricsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkFabrics to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkFabricsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @BodyParam("application/json") NetworkFabricInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}") + @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("networkFabricName") String networkFabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @BodyParam("application/json") NetworkFabricPatchParameters body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}") + @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("networkFabricName") String networkFabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabrics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/provision") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> provision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/deprovision") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deprovision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @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); + + @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); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + body, + accept, + context); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricInner> beginCreateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, networkFabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricInner.class, + NetworkFabricInner.class, + this.client.getContext()); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricInner> beginCreateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkFabricName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkFabricInner.class, NetworkFabricInner.class, context); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricInner> beginCreate( + String resourceGroupName, String networkFabricName, NetworkFabricInner body) { + return this.beginCreateAsync(resourceGroupName, networkFabricName, body).getSyncPoller(); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricInner> beginCreate( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, networkFabricName, body, context).getSyncPoller(); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body) { + return beginCreateAsync(resourceGroupName, networkFabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context) { + return beginCreateAsync(resourceGroupName, networkFabricName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricInner create(String resourceGroupName, String networkFabricName, NetworkFabricInner body) { + return createAsync(resourceGroupName, networkFabricName, body).block(); + } + + /** + * Create Network Fabric. + * + *

Create Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricInner create( + String resourceGroupName, String networkFabricName, NetworkFabricInner body, Context context) { + return createAsync(resourceGroupName, networkFabricName, body, context).block(); + } + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fabric resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFabricName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName 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(), + networkFabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fabric resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkFabricName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName 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(), + networkFabricName, + accept, + context); + } + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fabric resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkFabricName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFabricName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fabric resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkFabricName, context).block(); + } + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fabric resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricInner getByResourceGroup(String resourceGroupName, String networkFabricName) { + return getByResourceGroupWithResponse(resourceGroupName, networkFabricName, Context.NONE).getValue(); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + body, + accept, + context); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricInner> beginUpdateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, networkFabricName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkFabricInner.class, + NetworkFabricInner.class, + this.client.getContext()); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFabricInner> beginUpdateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkFabricName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkFabricInner.class, NetworkFabricInner.class, context); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricInner> beginUpdate( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body) { + return this.beginUpdateAsync(resourceGroupName, networkFabricName, body).getSyncPoller(); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFabricInner> beginUpdate( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context) { + return this.beginUpdateAsync(resourceGroupName, networkFabricName, body, context).getSyncPoller(); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body) { + return beginUpdateAsync(resourceGroupName, networkFabricName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context) { + return beginUpdateAsync(resourceGroupName, networkFabricName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricInner update( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body) { + return updateAsync(resourceGroupName, networkFabricName, body).block(); + } + + /** + * Updates a Network Fabric. + * + *

Update certain properties of the Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param body Network Fabric properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabric resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFabricInner update( + String resourceGroupName, String networkFabricName, NetworkFabricPatchParameters body, Context context) { + return updateAsync(resourceGroupName, networkFabricName, body, context).block(); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName 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(), + networkFabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName 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(), + networkFabricName, + accept, + context); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkFabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkFabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName) { + return this.beginDeleteAsync(resourceGroupName, networkFabricName).getSyncPoller(); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkFabricName, context).getSyncPoller(); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricName) { + return beginDeleteAsync(resourceGroupName, networkFabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricName, Context context) { + return beginDeleteAsync(resourceGroupName, networkFabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricName) { + deleteAsync(resourceGroupName, networkFabricName).block(); + } + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricName, Context context) { + deleteAsync(resourceGroupName, networkFabricName, context).block(); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics 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())); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics 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)); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics 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)); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> provisionWithResponseAsync( + String resourceGroupName, String networkFabricName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .provision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> provisionWithResponseAsync( + String resourceGroupName, String networkFabricName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .provision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginProvisionAsync(String resourceGroupName, String networkFabricName) { + Mono>> mono = provisionWithResponseAsync(resourceGroupName, networkFabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginProvisionAsync( + String resourceGroupName, String networkFabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + provisionWithResponseAsync(resourceGroupName, networkFabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginProvision(String resourceGroupName, String networkFabricName) { + return this.beginProvisionAsync(resourceGroupName, networkFabricName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginProvision( + String resourceGroupName, String networkFabricName, Context context) { + return this.beginProvisionAsync(resourceGroupName, networkFabricName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 provisionAsync(String resourceGroupName, String networkFabricName) { + return beginProvisionAsync(resourceGroupName, networkFabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 provisionAsync(String resourceGroupName, String networkFabricName, Context context) { + return beginProvisionAsync(resourceGroupName, networkFabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 provision(String resourceGroupName, String networkFabricName) { + provisionAsync(resourceGroupName, networkFabricName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 provision(String resourceGroupName, String networkFabricName, Context context) { + provisionAsync(resourceGroupName, networkFabricName, context).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deprovisionWithResponseAsync( + String resourceGroupName, String networkFabricName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deprovision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deprovisionWithResponseAsync( + String resourceGroupName, String networkFabricName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deprovision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeprovisionAsync( + String resourceGroupName, String networkFabricName) { + Mono>> mono = deprovisionWithResponseAsync(resourceGroupName, networkFabricName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeprovisionAsync( + String resourceGroupName, String networkFabricName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deprovisionWithResponseAsync(resourceGroupName, networkFabricName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeprovision(String resourceGroupName, String networkFabricName) { + return this.beginDeprovisionAsync(resourceGroupName, networkFabricName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeprovision( + String resourceGroupName, String networkFabricName, Context context) { + return this.beginDeprovisionAsync(resourceGroupName, networkFabricName, context).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deprovisionAsync(String resourceGroupName, String networkFabricName) { + return beginDeprovisionAsync(resourceGroupName, networkFabricName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deprovisionAsync(String resourceGroupName, String networkFabricName, Context context) { + return beginDeprovisionAsync(resourceGroupName, networkFabricName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deprovision(String resourceGroupName, String networkFabricName) { + deprovisionAsync(resourceGroupName, networkFabricName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deprovision(String resourceGroupName, String networkFabricName, Context context) { + deprovisionAsync(resourceGroupName, networkFabricName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkFabrics 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 URL to get the next list of items + *

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 NetworkFabrics 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkFabrics 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 URL to get the next list of items + *

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 NetworkFabrics 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java new file mode 100644 index 000000000000..1540d87b9533 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.NetworkFabricsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabrics; + +public final class NetworkFabricsImpl implements NetworkFabrics { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFabricsImpl.class); + + private final NetworkFabricsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkFabricsImpl( + NetworkFabricsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkFabricName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkFabricImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFabric getByResourceGroup(String resourceGroupName, String networkFabricName) { + NetworkFabricInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkFabricName); + if (inner != null) { + return new NetworkFabricImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkFabricName) { + this.serviceClient().delete(resourceGroupName, networkFabricName); + } + + public void delete(String resourceGroupName, String networkFabricName, Context context) { + this.serviceClient().delete(resourceGroupName, networkFabricName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkFabricImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkFabricImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkFabricImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkFabricImpl(inner1, this.manager())); + } + + public void provision(String resourceGroupName, String networkFabricName) { + this.serviceClient().provision(resourceGroupName, networkFabricName); + } + + public void provision(String resourceGroupName, String networkFabricName, Context context) { + this.serviceClient().provision(resourceGroupName, networkFabricName, context); + } + + public void deprovision(String resourceGroupName, String networkFabricName) { + this.serviceClient().deprovision(resourceGroupName, networkFabricName); + } + + public void deprovision(String resourceGroupName, String networkFabricName, Context context) { + this.serviceClient().deprovision(resourceGroupName, networkFabricName, context); + } + + public NetworkFabric 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkFabricName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkFabricName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + this.delete(resourceGroupName, networkFabricName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + this.delete(resourceGroupName, networkFabricName, context); + } + + private NetworkFabricsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkFabricImpl define(String name) { + return new NetworkFabricImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java new file mode 100644 index 000000000000..bd6418ea581f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.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.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceStatus; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceType; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacePatch; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +public final class NetworkInterfaceImpl + implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + private NetworkInterfaceInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String physicalIdentifier() { + return this.innerModel().physicalIdentifier(); + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String connectedTo() { + return this.innerModel().connectedTo(); + } + + public InterfaceType interfaceType() { + return this.innerModel().interfaceType(); + } + + public String ipv4Address() { + return this.innerModel().ipv4Address(); + } + + public String ipv6Address() { + return this.innerModel().ipv6Address(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkInterfaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkDeviceName; + + private String networkInterfaceName; + + private NetworkInterfacePatch updateBody; + + public NetworkInterfaceImpl withExistingNetworkDevice(String resourceGroupName, String networkDeviceName) { + this.resourceGroupName = resourceGroupName; + this.networkDeviceName = networkDeviceName; + return this; + } + + public NetworkInterface create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .create(resourceGroupName, networkDeviceName, networkInterfaceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterface create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .create(resourceGroupName, networkDeviceName, networkInterfaceName, this.innerModel(), context); + return this; + } + + NetworkInterfaceImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkInterfaceInner(); + this.serviceManager = serviceManager; + this.networkInterfaceName = name; + } + + public NetworkInterfaceImpl update() { + this.updateBody = new NetworkInterfacePatch(); + return this; + } + + public NetworkInterface apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .update(resourceGroupName, networkDeviceName, networkInterfaceName, updateBody, Context.NONE); + return this; + } + + public NetworkInterface apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .update(resourceGroupName, networkDeviceName, networkInterfaceName, updateBody, context); + return this; + } + + NetworkInterfaceImpl( + NetworkInterfaceInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkDeviceName = Utils.getValueFromIdByName(innerObject.id(), "networkDevices"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + } + + public NetworkInterface refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, context) + .getValue(); + return this; + } + + public InterfaceStatus getStatus() { + return serviceManager.networkInterfaces().getStatus(resourceGroupName, networkDeviceName, networkInterfaceName); + } + + public InterfaceStatus getStatus(Context context) { + return serviceManager + .networkInterfaces() + .getStatus(resourceGroupName, networkDeviceName, networkInterfaceName, context); + } + + public void updateAdministrativeState(UpdateAdministrativeState body) { + serviceManager + .networkInterfaces() + .updateAdministrativeState(resourceGroupName, networkDeviceName, networkInterfaceName, body); + } + + public void updateAdministrativeState(UpdateAdministrativeState body, Context context) { + serviceManager + .networkInterfaces() + .updateAdministrativeState(resourceGroupName, networkDeviceName, networkInterfaceName, body, context); + } + + public NetworkInterfaceImpl withAnnotation(String annotation) { + if (isInCreateMode()) { + this.innerModel().withAnnotation(annotation); + return this; + } else { + this.updateBody.withAnnotation(annotation); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesClientImpl.java new file mode 100644 index 000000000000..6409c7680fc6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesClientImpl.java @@ -0,0 +1,2211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InterfaceStatusInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacePatch; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfacesList; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +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 NetworkInterfacesClient. */ +public final class NetworkInterfacesClientImpl implements NetworkInterfacesClient { + /** The proxy service used to perform REST calls. */ + private final NetworkInterfacesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfacesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkInterfacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkInterfaces to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkInterfacesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @BodyParam("application/json") NetworkInterfaceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}") + @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("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @BodyParam("application/json") NetworkInterfacePatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}") + @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("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/getStatus") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName}/networkInterfaces/{networkInterfaceName}/updateAdministrativeState") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAdministrativeState( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkDeviceName") String networkDeviceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @BodyParam("application/json") UpdateAdministrativeState body, + @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); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfaceInner> beginCreateAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfaceInner.class, + NetworkInterfaceInner.class, + this.client.getContext()); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfaceInner> beginCreateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkInterfaceInner.class, NetworkInterfaceInner.class, context); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginCreate( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body) { + return this.beginCreateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body).getSyncPoller(); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginCreate( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .getSyncPoller(); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body) { + return beginCreateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner create( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfaceInner body) { + return createAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body).block(); + } + + /** + * Create NetworkInterface. + * + *

Create a Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner create( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfaceInner body, + Context context) { + return createAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context).block(); + } + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName 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(), + networkDeviceName, + networkInterfaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName 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(), + networkDeviceName, + networkInterfaceName, + accept, + context); + } + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + return getWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + return getWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context).block(); + } + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner get(String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + return getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, Context.NONE).getValue(); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfaceInner> beginUpdateAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkInterfaceInner.class, + NetworkInterfaceInner.class, + this.client.getContext()); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkInterfaceInner> beginUpdateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkInterfaceInner.class, NetworkInterfaceInner.class, context); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginUpdate( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body) { + return this.beginUpdateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body).getSyncPoller(); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginUpdate( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .getSyncPoller(); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body) { + return beginUpdateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner update( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, NetworkInterfacePatch body) { + return updateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body).block(); + } + + /** + * Updates a NetworkInterface. + * + *

Update certain properties of the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param body NetworkInterface properties to update. Only tags are supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the NetworkInterface resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner update( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + NetworkInterfacePatch body, + Context context) { + return updateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context).block(); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName 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(), + networkDeviceName, + networkInterfaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName 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(), + networkDeviceName, + networkInterfaceName, + accept, + context); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName) { + return this.beginDeleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName).getSyncPoller(); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkDeviceName, String networkInterfaceName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context) + .getSyncPoller(); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkDeviceName, String networkInterfaceName) { + return beginDeleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkDeviceName, String networkInterfaceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkDeviceName, String networkInterfaceName) { + deleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName).block(); + } + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkDeviceName, String networkInterfaceName, Context context) { + deleteAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context).block(); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkDeviceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkDeviceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkDeviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkDeviceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkDeviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkDeviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkDeviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkDeviceName)); + } + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkDeviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkDeviceName, context)); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getStatusWithResponseAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + accept, + context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InterfaceStatusInner> beginGetStatusAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + Mono>> mono = + getStatusWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + InterfaceStatusInner.class, + InterfaceStatusInner.class, + this.client.getContext()); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, InterfaceStatusInner> beginGetStatusAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + getStatusWithResponseAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), InterfaceStatusInner.class, InterfaceStatusInner.class, context); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InterfaceStatusInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + return this.beginGetStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName).getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InterfaceStatusInner> beginGetStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + return this + .beginGetStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context) + .getSyncPoller(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + return beginGetStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatusAsync( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + return beginGetStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InterfaceStatusInner getStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + return getStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName).block(); + } + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InterfaceStatusInner getStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + return getStatusAsync(resourceGroupName, networkDeviceName, networkInterfaceName, context).block(); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> updateAdministrativeStateWithResponseAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + 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 (networkDeviceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkDeviceName is required and cannot be null.")); + } + if (networkInterfaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAdministrativeState( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkDeviceName, + networkInterfaceName, + body, + accept, + context); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, networkDeviceName, networkInterfaceName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeStateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAdministrativeStateWithResponseAsync( + resourceGroupName, networkDeviceName, networkInterfaceName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + return this + .beginUpdateAdministrativeStateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body) + .getSyncPoller(); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginUpdateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context) { + return this + .beginUpdateAdministrativeStateAsync( + resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .getSyncPoller(); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + return beginUpdateAdministrativeStateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAdministrativeStateAsync( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context) { + return beginUpdateAdministrativeStateAsync( + resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + updateAdministrativeStateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body).block(); + } + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context) { + updateAdministrativeStateAsync(resourceGroupName, networkDeviceName, networkInterfaceName, body, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkInterfaces 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 URL to get the next list of items + *

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 NetworkInterfaces 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesImpl.java new file mode 100644 index 000000000000..5ae57eb0f49c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InterfaceStatusInner; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.managednetworkfabric.models.InterfaceStatus; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterfaces; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +public final class NetworkInterfacesImpl implements NetworkInterfaces { + private static final ClientLogger LOGGER = new ClientLogger(NetworkInterfacesImpl.class); + + private final NetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkInterfacesImpl( + NetworkInterfacesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkInterface get(String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + NetworkInterfaceInner inner = + this.serviceClient().get(resourceGroupName, networkDeviceName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + this.serviceClient().delete(resourceGroupName, networkDeviceName, networkInterfaceName); + } + + public void delete( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkDeviceName, networkInterfaceName, context); + } + + public PagedIterable list(String resourceGroupName, String networkDeviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkDeviceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkDeviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkDeviceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public InterfaceStatus getStatus(String resourceGroupName, String networkDeviceName, String networkInterfaceName) { + InterfaceStatusInner inner = + this.serviceClient().getStatus(resourceGroupName, networkDeviceName, networkInterfaceName); + if (inner != null) { + return new InterfaceStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public InterfaceStatus getStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context) { + InterfaceStatusInner inner = + this.serviceClient().getStatus(resourceGroupName, networkDeviceName, networkInterfaceName, context); + if (inner != null) { + return new InterfaceStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public void updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, networkDeviceName, networkInterfaceName, body); + } + + public void updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context) { + this + .serviceClient() + .updateAdministrativeState(resourceGroupName, networkDeviceName, networkInterfaceName, body, context); + } + + public NetworkInterface 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getWithResponse(resourceGroupName, networkDeviceName, networkInterfaceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkDeviceName, networkInterfaceName, 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 networkDeviceName = Utils.getValueFromIdByName(id, "networkDevices"); + if (networkDeviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkDevices'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkDeviceName, networkInterfaceName, context); + } + + private NetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceImpl define(String name) { + return new NetworkInterfaceImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackImpl.java new file mode 100644 index 000000000000..d6c2d6f4b396 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkRackImpl implements NetworkRack, NetworkRack.Definition, NetworkRack.Update { + private NetworkRackInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkRackSku() { + return this.innerModel().networkRackSku(); + } + + public String networkFabricId() { + return this.innerModel().networkFabricId(); + } + + public List networkDevices() { + List inner = this.innerModel().networkDevices(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkRackInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkRackName; + + private NetworkRackPatch updateBody; + + public NetworkRackImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkRack create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .create(resourceGroupName, networkRackName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkRack create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .create(resourceGroupName, networkRackName, this.innerModel(), context); + return this; + } + + NetworkRackImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkRackInner(); + this.serviceManager = serviceManager; + this.networkRackName = name; + } + + public NetworkRackImpl update() { + this.updateBody = new NetworkRackPatch(); + return this; + } + + public NetworkRack apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .update(resourceGroupName, networkRackName, updateBody, Context.NONE); + return this; + } + + public NetworkRack apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .update(resourceGroupName, networkRackName, updateBody, context); + return this; + } + + NetworkRackImpl( + NetworkRackInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkRackName = Utils.getValueFromIdByName(innerObject.id(), "networkRacks"); + } + + public NetworkRack refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .getByResourceGroupWithResponse(resourceGroupName, networkRackName, Context.NONE) + .getValue(); + return this; + } + + public NetworkRack refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkRacks() + .getByResourceGroupWithResponse(resourceGroupName, networkRackName, context) + .getValue(); + return this; + } + + public NetworkRackImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkRackImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkRackImpl withNetworkRackSku(String networkRackSku) { + this.innerModel().withNetworkRackSku(networkRackSku); + return this; + } + + public NetworkRackImpl withNetworkFabricId(String networkFabricId) { + this.innerModel().withNetworkFabricId(networkFabricId); + return this; + } + + public NetworkRackImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NetworkRackImpl withAnnotation(String annotation) { + this.innerModel().withAnnotation(annotation); + return this; + } + + public NetworkRackImpl withProperties(Object properties) { + this.updateBody.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkuImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkuImpl.java new file mode 100644 index 000000000000..c53ca6fcb8a4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkuImpl.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.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSku; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkuPropertiesNetworkDevicesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class NetworkRackSkuImpl implements NetworkRackSku { + private NetworkRackSkuInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + NetworkRackSkuImpl( + NetworkRackSkuInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkRackRoleName roleName() { + return this.innerModel().roleName(); + } + + public Integer maximumServerCount() { + return this.innerModel().maximumServerCount(); + } + + public Integer maximumStorageCount() { + return this.innerModel().maximumStorageCount(); + } + + public Integer maximumUplinks() { + return this.innerModel().maximumUplinks(); + } + + public List networkDevices() { + List inner = this.innerModel().networkDevices(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkRackSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusClientImpl.java new file mode 100644 index 000000000000..1ea3284d081d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusClientImpl.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.resourcemanager.managednetworkfabric.fluent.NetworkRackSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkusListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkRackSkusClient. */ +public final class NetworkRackSkusClientImpl implements NetworkRackSkusClient { + /** The proxy service used to perform REST calls. */ + private final NetworkRackSkusService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkRackSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkRackSkusClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkRackSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkRackSkus to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkRackSkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRackSkus/{networkRackSkuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("networkRackSkuName") String networkRackSkuName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRackSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack SKU resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkRackSkuName) { + 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 (networkRackSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackSkuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + networkRackSkuName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack SKU resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkRackSkuName, 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 (networkRackSkuName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackSkuName 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(), + this.client.getApiVersion(), + networkRackSkuName, + accept, + context); + } + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack SKU resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String networkRackSkuName) { + return getWithResponseAsync(networkRackSkuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack SKU resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String networkRackSkuName, Context context) { + return getWithResponseAsync(networkRackSkuName, context).block(); + } + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack SKU resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackSkuInner get(String networkRackSkuName) { + return getWithResponse(networkRackSkuName, Context.NONE).getValue(); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus 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 URL to get the next list of items + *

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 NetworkRackSkus 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 URL to get the next list of items + *

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 NetworkRackSkus 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusImpl.java new file mode 100644 index 000000000000..76289bdbfe08 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusImpl.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.managednetworkfabric.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.managednetworkfabric.fluent.NetworkRackSkusClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSku; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSkus; + +public final class NetworkRackSkusImpl implements NetworkRackSkus { + private static final ClientLogger LOGGER = new ClientLogger(NetworkRackSkusImpl.class); + + private final NetworkRackSkusClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkRackSkusImpl( + NetworkRackSkusClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String networkRackSkuName, Context context) { + Response inner = this.serviceClient().getWithResponse(networkRackSkuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkRackSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkRackSku get(String networkRackSkuName) { + NetworkRackSkuInner inner = this.serviceClient().get(networkRackSkuName); + if (inner != null) { + return new NetworkRackSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkRackSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkRackSkuImpl(inner1, this.manager())); + } + + private NetworkRackSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksClientImpl.java new file mode 100644 index 000000000000..708d569561a0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksClientImpl.java @@ -0,0 +1,1628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkRacksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackPatch; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRacksListResult; +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 NetworkRacksClient. */ +public final class NetworkRacksClientImpl implements NetworkRacksClient { + /** The proxy service used to perform REST calls. */ + private final NetworkRacksService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkRacksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkRacksClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(NetworkRacksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkRacks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkRacksService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkRackName") String networkRackName, + @BodyParam("application/json") NetworkRackInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}") + @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("networkRackName") String networkRackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkRackName") String networkRackName, + @BodyParam("application/json") NetworkRackPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName}") + @ExpectedResponses({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("networkRackName") String networkRackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkRacks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body) { + 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkRackName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body, 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkRackName, + body, + accept, + context); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkRackInner> beginCreateAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, networkRackName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkRackInner.class, + NetworkRackInner.class, + this.client.getContext()); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkRackInner> beginCreateAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkRackName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkRackInner.class, NetworkRackInner.class, context); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkRackInner> beginCreate( + String resourceGroupName, String networkRackName, NetworkRackInner body) { + return this.beginCreateAsync(resourceGroupName, networkRackName, body).getSyncPoller(); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkRackInner> beginCreate( + String resourceGroupName, String networkRackName, NetworkRackInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, networkRackName, body, context).getSyncPoller(); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body) { + return beginCreateAsync(resourceGroupName, networkRackName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String networkRackName, NetworkRackInner body, Context context) { + return beginCreateAsync(resourceGroupName, networkRackName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackInner create(String resourceGroupName, String networkRackName, NetworkRackInner body) { + return createAsync(resourceGroupName, networkRackName, body).block(); + } + + /** + * Create Network Rack. + * + *

Create Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackInner create( + String resourceGroupName, String networkRackName, NetworkRackInner body, Context context) { + return createAsync(resourceGroupName, networkRackName, body, context).block(); + } + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkRackName) { + 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName 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(), + networkRackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String networkRackName, 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName 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(), + networkRackName, + accept, + context); + } + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkRackName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkRackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkRackName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkRackName, context).block(); + } + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Rack resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackInner getByResourceGroup(String resourceGroupName, String networkRackName) { + return getByResourceGroupWithResponse(resourceGroupName, networkRackName, Context.NONE).getValue(); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body) { + 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkRackName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body, 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkRackName, + body, + accept, + context); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkRackInner> beginUpdateAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, networkRackName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkRackInner.class, + NetworkRackInner.class, + this.client.getContext()); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkRackInner> beginUpdateAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, networkRackName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetworkRackInner.class, NetworkRackInner.class, context); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkRackInner> beginUpdate( + String resourceGroupName, String networkRackName, NetworkRackPatch body) { + return this.beginUpdateAsync(resourceGroupName, networkRackName, body).getSyncPoller(); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkRackInner> beginUpdate( + String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, networkRackName, body, context).getSyncPoller(); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body) { + return beginUpdateAsync(resourceGroupName, networkRackName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, networkRackName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackInner update(String resourceGroupName, String networkRackName, NetworkRackPatch body) { + return updateAsync(resourceGroupName, networkRackName, body).block(); + } + + /** + * Updates a Network Rack. + * + *

Update certain properties of the Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param body Network Rack properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkRack resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkRackInner update( + String resourceGroupName, String networkRackName, NetworkRackPatch body, Context context) { + return updateAsync(resourceGroupName, networkRackName, body, context).block(); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName) { + 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName 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(), + networkRackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName, 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 (networkRackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkRackName 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(), + networkRackName, + accept, + context); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkRackName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkRackName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName) { + return this.beginDeleteAsync(resourceGroupName, networkRackName).getSyncPoller(); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkRackName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkRackName, context).getSyncPoller(); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkRackName) { + return beginDeleteAsync(resourceGroupName, networkRackName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkRackName, Context context) { + return beginDeleteAsync(resourceGroupName, networkRackName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkRackName) { + deleteAsync(resourceGroupName, networkRackName).block(); + } + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkRackName, Context context) { + deleteAsync(resourceGroupName, networkRackName, context).block(); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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())); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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)); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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)); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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.getSubscriptionId(), + 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())); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks 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 URL to get the next list of items + *

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 NetworkRacks 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 URL to get the next list of items + *

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 NetworkRacks 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkRacks 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 URL to get the next list of items + *

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 NetworkRacks 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksImpl.java new file mode 100644 index 000000000000..e10a66f72043 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.NetworkRacksClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRacks; + +public final class NetworkRacksImpl implements NetworkRacks { + private static final ClientLogger LOGGER = new ClientLogger(NetworkRacksImpl.class); + + private final NetworkRacksClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkRacksImpl( + NetworkRacksClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkRackName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkRackName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkRackImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkRack getByResourceGroup(String resourceGroupName, String networkRackName) { + NetworkRackInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkRackName); + if (inner != null) { + return new NetworkRackImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkRackName) { + this.serviceClient().delete(resourceGroupName, networkRackName); + } + + public void delete(String resourceGroupName, String networkRackName, Context context) { + this.serviceClient().delete(resourceGroupName, networkRackName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkRackImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkRackImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkRackImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkRackImpl(inner1, this.manager())); + } + + public NetworkRack 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 networkRackName = Utils.getValueFromIdByName(id, "networkRacks"); + if (networkRackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkRacks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkRackName, 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 networkRackName = Utils.getValueFromIdByName(id, "networkRacks"); + if (networkRackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkRacks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkRackName, 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 networkRackName = Utils.getValueFromIdByName(id, "networkRacks"); + if (networkRackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkRacks'.", id))); + } + this.delete(resourceGroupName, networkRackName, 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 networkRackName = Utils.getValueFromIdByName(id, "networkRacks"); + if (networkRackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkRacks'.", id))); + } + this.delete(resourceGroupName, networkRackName, context); + } + + private NetworkRacksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkRackImpl define(String name) { + return new NetworkRackImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java new file mode 100644 index 000000000000..25ead5adc61e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesLayer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; + +public final class NetworkToNetworkInterconnectImpl + implements NetworkToNetworkInterconnect, NetworkToNetworkInterconnect.Definition { + private NetworkToNetworkInterconnectInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + NetworkToNetworkInterconnectImpl( + NetworkToNetworkInterconnectInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public BooleanEnumProperty isManagementType() { + return this.innerModel().isManagementType(); + } + + public BooleanEnumProperty useOptionB() { + return this.innerModel().useOptionB(); + } + + public NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration() { + return this.innerModel().layer2Configuration(); + } + + public Layer3Configuration layer3Configuration() { + return this.innerModel().layer3Configuration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkToNetworkInterconnectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkFabricName; + + private String networkToNetworkInterconnectName; + + public NetworkToNetworkInterconnectImpl withExistingNetworkFabric( + String resourceGroupName, String networkFabricName) { + this.resourceGroupName = resourceGroupName; + this.networkFabricName = networkFabricName; + return this; + } + + public NetworkToNetworkInterconnect create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkToNetworkInterconnects() + .create( + resourceGroupName, + networkFabricName, + networkToNetworkInterconnectName, + this.innerModel(), + Context.NONE); + return this; + } + + public NetworkToNetworkInterconnect create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkToNetworkInterconnects() + .create( + resourceGroupName, networkFabricName, networkToNetworkInterconnectName, this.innerModel(), context); + return this; + } + + NetworkToNetworkInterconnectImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new NetworkToNetworkInterconnectInner(); + this.serviceManager = serviceManager; + this.networkToNetworkInterconnectName = name; + } + + public NetworkToNetworkInterconnect refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkToNetworkInterconnects() + .getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, Context.NONE) + .getValue(); + return this; + } + + public NetworkToNetworkInterconnect refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkToNetworkInterconnects() + .getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context) + .getValue(); + return this; + } + + public NetworkToNetworkInterconnectImpl withIsManagementType(BooleanEnumProperty isManagementType) { + this.innerModel().withIsManagementType(isManagementType); + return this; + } + + public NetworkToNetworkInterconnectImpl withUseOptionB(BooleanEnumProperty useOptionB) { + this.innerModel().withUseOptionB(useOptionB); + return this; + } + + public NetworkToNetworkInterconnectImpl withLayer2Configuration( + NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration) { + this.innerModel().withLayer2Configuration(layer2Configuration); + return this; + } + + public NetworkToNetworkInterconnectImpl withLayer3Configuration(Layer3Configuration layer3Configuration) { + this.innerModel().withLayer3Configuration(layer3Configuration); + return this; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsClientImpl.java new file mode 100644 index 000000000000..dd4b9c614085 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsClientImpl.java @@ -0,0 +1,1241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.NetworkToNetworkInterconnectsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectsList; +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 NetworkToNetworkInterconnectsClient. */ +public final class NetworkToNetworkInterconnectsClientImpl implements NetworkToNetworkInterconnectsClient { + /** The proxy service used to perform REST calls. */ + private final NetworkToNetworkInterconnectsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of NetworkToNetworkInterconnectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkToNetworkInterconnectsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy + .create( + NetworkToNetworkInterconnectsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiNetworkToNetworkInterconnects + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface NetworkToNetworkInterconnectsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @PathParam("networkToNetworkInterconnectName") String networkToNetworkInterconnectName, + @BodyParam("application/json") NetworkToNetworkInterconnectInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}") + @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("networkFabricName") String networkFabricName, + @PathParam("networkToNetworkInterconnectName") String networkToNetworkInterconnectName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects/{networkToNetworkInterconnectName}") + @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("networkFabricName") String networkFabricName, + @PathParam("networkToNetworkInterconnectName") String networkToNetworkInterconnectName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/networkToNetworkInterconnects") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("networkFabricName") String networkFabricName, + @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); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + networkToNetworkInterconnectName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + networkToNetworkInterconnectName, + body, + accept, + context); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkToNetworkInterconnectInner> + beginCreateAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkToNetworkInterconnectInner.class, + NetworkToNetworkInterconnectInner.class, + this.client.getContext()); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkToNetworkInterconnectInner> + beginCreateAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NetworkToNetworkInterconnectInner.class, + NetworkToNetworkInterconnectInner.class, + context); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkToNetworkInterconnectInner> beginCreate( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body) { + return this + .beginCreateAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body) + .getSyncPoller(); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkToNetworkInterconnectInner> beginCreate( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, context) + .getSyncPoller(); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body) { + return beginCreateAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context) { + return beginCreateAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkToNetworkInterconnectInner create( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body) { + return createAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body).block(); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Configuration used to setup CE-PE connectivity PUT Method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkToNetworkInterconnectInner create( + String resourceGroupName, + String networkFabricName, + String networkToNetworkInterconnectName, + NetworkToNetworkInterconnectInner body, + Context context) { + return createAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, context) + .block(); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName 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(), + networkFabricName, + networkToNetworkInterconnectName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName 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(), + networkFabricName, + networkToNetworkInterconnectName, + accept, + context); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName) { + return getWithResponseAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, Context context) { + return getWithResponseAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context) + .block(); + } + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkToNetworkInterconnectInner get( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName) { + return getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, Context.NONE) + .getValue(); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName 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(), + networkFabricName, + networkToNetworkInterconnectName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + if (networkToNetworkInterconnectName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter networkToNetworkInterconnectName 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(), + networkFabricName, + networkToNetworkInterconnectName, + accept, + context); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName) { + return this + .beginDeleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName) + .getSyncPoller(); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 networkFabricName, String networkToNetworkInterconnectName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context) + .getSyncPoller(); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricName, String networkToNetworkInterconnectName) { + return beginDeleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkFabricName, String networkToNetworkInterconnectName, Context context) { + return beginDeleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricName, String networkToNetworkInterconnectName) { + deleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName).block(); + } + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkFabricName, String networkToNetworkInterconnectName, Context context) { + deleteAsync(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context).block(); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkFabricName) { + 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + 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())); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String networkFabricName, 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 (networkFabricName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkFabricName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + networkFabricName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkFabricName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkFabricName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkFabricName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkFabricName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkFabricName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkFabricName)); + } + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkFabricName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkFabricName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 NetworkToNetworkInterconnects 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 URL to get the next list of items + *

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 NetworkToNetworkInterconnects 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsImpl.java new file mode 100644 index 000000000000..cfb6b75c6591 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.NetworkToNetworkInterconnectsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnects; + +public final class NetworkToNetworkInterconnectsImpl implements NetworkToNetworkInterconnects { + private static final ClientLogger LOGGER = new ClientLogger(NetworkToNetworkInterconnectsImpl.class); + + private final NetworkToNetworkInterconnectsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public NetworkToNetworkInterconnectsImpl( + NetworkToNetworkInterconnectsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkToNetworkInterconnectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkToNetworkInterconnect get( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName) { + NetworkToNetworkInterconnectInner inner = + this.serviceClient().get(resourceGroupName, networkFabricName, networkToNetworkInterconnectName); + if (inner != null) { + return new NetworkToNetworkInterconnectImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName) { + this.serviceClient().delete(resourceGroupName, networkFabricName, networkToNetworkInterconnectName); + } + + public void delete( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, Context context) { + this.serviceClient().delete(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context); + } + + public PagedIterable list(String resourceGroupName, String networkFabricName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkFabricName); + return Utils.mapPage(inner, inner1 -> new NetworkToNetworkInterconnectImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkFabricName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkFabricName, context); + return Utils.mapPage(inner, inner1 -> new NetworkToNetworkInterconnectImpl(inner1, this.manager())); + } + + public NetworkToNetworkInterconnect 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + String networkToNetworkInterconnectName = Utils.getValueFromIdByName(id, "networkToNetworkInterconnects"); + if (networkToNetworkInterconnectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkToNetworkInterconnects'.", + id))); + } + return this + .getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + String networkToNetworkInterconnectName = Utils.getValueFromIdByName(id, "networkToNetworkInterconnects"); + if (networkToNetworkInterconnectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkToNetworkInterconnects'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + String networkToNetworkInterconnectName = Utils.getValueFromIdByName(id, "networkToNetworkInterconnects"); + if (networkToNetworkInterconnectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkToNetworkInterconnects'.", + id))); + } + this.delete(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, 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 networkFabricName = Utils.getValueFromIdByName(id, "networkFabrics"); + if (networkFabricName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFabrics'.", id))); + } + String networkToNetworkInterconnectName = Utils.getValueFromIdByName(id, "networkToNetworkInterconnects"); + if (networkToNetworkInterconnectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'networkToNetworkInterconnects'.", + id))); + } + this.delete(resourceGroupName, networkFabricName, networkToNetworkInterconnectName, context); + } + + private NetworkToNetworkInterconnectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public NetworkToNetworkInterconnectImpl define(String name) { + return new NetworkToNetworkInterconnectImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationImpl.java new file mode 100644 index 000000000000..974ff8a640cb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.managednetworkfabric.models.ActionType; +import com.azure.resourcemanager.managednetworkfabric.models.Operation; +import com.azure.resourcemanager.managednetworkfabric.models.OperationDisplay; +import com.azure.resourcemanager.managednetworkfabric.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..6be169b6397b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.resourcemanager.managednetworkfabric.fluent.OperationsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.managednetworkfabric.models.OperationListResult; +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 { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ManagedNetworkFabric/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); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider 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())); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider 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)); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider 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 URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider 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 URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsImpl.java new file mode 100644 index 000000000000..58d3a20d0d5a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/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.managednetworkfabric.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.managednetworkfabric.fluent.OperationsClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; +import com.azure.resourcemanager.managednetworkfabric.models.Operation; +import com.azure.resourcemanager.managednetworkfabric.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager 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.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesClientImpl.java new file mode 100644 index 000000000000..27934c6223c5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesClientImpl.java @@ -0,0 +1,1628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.managednetworkfabric.fluent.RoutePoliciesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePoliciesListResult; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPatch; +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 RoutePoliciesClient. */ +public final class RoutePoliciesClientImpl implements RoutePoliciesClient { + /** The proxy service used to perform REST calls. */ + private final RoutePoliciesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of RoutePoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutePoliciesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(RoutePoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiRoutePolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface RoutePoliciesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("routePolicyName") String routePolicyName, + @BodyParam("application/json") RoutePolicyInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}") + @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("routePolicyName") String routePolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("routePolicyName") String routePolicyName, + @BodyParam("application/json") RoutePolicyPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName}") + @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("routePolicyName") String routePolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies") + @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"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/routePolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @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); + + @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); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body) { + 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + routePolicyName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + routePolicyName, + body, + accept, + context); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutePolicyInner> beginCreateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, routePolicyName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RoutePolicyInner.class, + RoutePolicyInner.class, + this.client.getContext()); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutePolicyInner> beginCreateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, routePolicyName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RoutePolicyInner.class, RoutePolicyInner.class, context); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutePolicyInner> beginCreate( + String resourceGroupName, String routePolicyName, RoutePolicyInner body) { + return this.beginCreateAsync(resourceGroupName, routePolicyName, body).getSyncPoller(); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutePolicyInner> beginCreate( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, routePolicyName, body, context).getSyncPoller(); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body) { + return beginCreateAsync(resourceGroupName, routePolicyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context) { + return beginCreateAsync(resourceGroupName, routePolicyName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutePolicyInner create(String resourceGroupName, String routePolicyName, RoutePolicyInner body) { + return createAsync(resourceGroupName, routePolicyName, body).block(); + } + + /** + * Create Route Policy. + * + *

Implements Route Policy PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutePolicyInner create( + String resourceGroupName, String routePolicyName, RoutePolicyInner body, Context context) { + return createAsync(resourceGroupName, routePolicyName, body, context).block(); + } + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routePolicyName) { + 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName 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(), + routePolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String routePolicyName, 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName 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(), + routePolicyName, + accept, + context); + } + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String routePolicyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routePolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routePolicyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routePolicyName, context).block(); + } + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutePolicyInner getByResourceGroup(String resourceGroupName, String routePolicyName) { + return getByResourceGroupWithResponse(resourceGroupName, routePolicyName, Context.NONE).getValue(); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body) { + 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + routePolicyName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + routePolicyName, + body, + accept, + context); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutePolicyInner> beginUpdateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, routePolicyName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RoutePolicyInner.class, + RoutePolicyInner.class, + this.client.getContext()); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutePolicyInner> beginUpdateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, routePolicyName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RoutePolicyInner.class, RoutePolicyInner.class, context); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutePolicyInner> beginUpdate( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body) { + return this.beginUpdateAsync(resourceGroupName, routePolicyName, body).getSyncPoller(); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutePolicyInner> beginUpdate( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, routePolicyName, body, context).getSyncPoller(); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body) { + return beginUpdateAsync(resourceGroupName, routePolicyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, routePolicyName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutePolicyInner update(String resourceGroupName, String routePolicyName, RoutePolicyPatch body) { + return updateAsync(resourceGroupName, routePolicyName, body).block(); + } + + /** + * Updates a Route Policy. + * + *

API to update certain properties of the Route Policy resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route Policy. + * @param body Route Policy properties to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutePolicyInner update( + String resourceGroupName, String routePolicyName, RoutePolicyPatch body, Context context) { + return updateAsync(resourceGroupName, routePolicyName, body, context).block(); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName) { + 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName 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(), + routePolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, 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 (routePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routePolicyName 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(), + routePolicyName, + accept, + context); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routePolicyName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, routePolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName) { + return this.beginDeleteAsync(resourceGroupName, routePolicyName).getSyncPoller(); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context) { + return this.beginDeleteAsync(resourceGroupName, routePolicyName, context).getSyncPoller(); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName) { + return beginDeleteAsync(resourceGroupName, routePolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, routePolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName) { + deleteAsync(resourceGroupName, routePolicyName).block(); + } + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context) { + deleteAsync(resourceGroupName, routePolicyName, context).block(); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies 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())); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies 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)); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies 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)); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @throws 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 RoutePolicies 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.getSubscriptionId(), + 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())); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RoutePolicies 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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @throws 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 RoutePolicies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RoutePolicies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @throws 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 RoutePolicies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RoutePolicies 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 URL to get the next list of items + *

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 RoutePolicies 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 URL to get the next list of items + *

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 RoutePolicies 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 RoutePolicies 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 URL to get the next list of items + *

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 RoutePolicies 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)); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesImpl.java new file mode 100644 index 000000000000..6496774cd7fe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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.managednetworkfabric.fluent.RoutePoliciesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicies; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; + +public final class RoutePoliciesImpl implements RoutePolicies { + private static final ClientLogger LOGGER = new ClientLogger(RoutePoliciesImpl.class); + + private final RoutePoliciesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public RoutePoliciesImpl( + RoutePoliciesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routePolicyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, routePolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoutePolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoutePolicy getByResourceGroup(String resourceGroupName, String routePolicyName) { + RoutePolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, routePolicyName); + if (inner != null) { + return new RoutePolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String routePolicyName) { + this.serviceClient().delete(resourceGroupName, routePolicyName); + } + + public void delete(String resourceGroupName, String routePolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, routePolicyName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RoutePolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RoutePolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RoutePolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RoutePolicyImpl(inner1, this.manager())); + } + + public RoutePolicy 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 routePolicyName = Utils.getValueFromIdByName(id, "routePolicies"); + if (routePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routePolicyName, 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 routePolicyName = Utils.getValueFromIdByName(id, "routePolicies"); + if (routePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routePolicyName, 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 routePolicyName = Utils.getValueFromIdByName(id, "routePolicies"); + if (routePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routePolicies'.", id))); + } + this.delete(resourceGroupName, routePolicyName, 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 routePolicyName = Utils.getValueFromIdByName(id, "routePolicies"); + if (routePolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routePolicies'.", id))); + } + this.delete(resourceGroupName, routePolicyName, context); + } + + private RoutePoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public RoutePolicyImpl define(String name) { + return new RoutePolicyImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java new file mode 100644 index 000000000000..a9886d0102d5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPatch; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItem; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RoutePolicyImpl implements RoutePolicy, RoutePolicy.Definition, RoutePolicy.Update { + private RoutePolicyInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public List conditions() { + List inner = this.innerModel().conditions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String annotation() { + return this.innerModel().annotation(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RoutePolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String routePolicyName; + + private RoutePolicyPatch updateBody; + + public RoutePolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RoutePolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .create(resourceGroupName, routePolicyName, this.innerModel(), Context.NONE); + return this; + } + + public RoutePolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .create(resourceGroupName, routePolicyName, this.innerModel(), context); + return this; + } + + RoutePolicyImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new RoutePolicyInner(); + this.serviceManager = serviceManager; + this.routePolicyName = name; + } + + public RoutePolicyImpl update() { + this.updateBody = new RoutePolicyPatch(); + return this; + } + + public RoutePolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .update(resourceGroupName, routePolicyName, updateBody, Context.NONE); + return this; + } + + public RoutePolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .update(resourceGroupName, routePolicyName, updateBody, context); + return this; + } + + RoutePolicyImpl( + RoutePolicyInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routePolicyName = Utils.getValueFromIdByName(innerObject.id(), "routePolicies"); + } + + public RoutePolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .getByResourceGroupWithResponse(resourceGroupName, routePolicyName, Context.NONE) + .getValue(); + return this; + } + + public RoutePolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutePolicies() + .getByResourceGroupWithResponse(resourceGroupName, routePolicyName, context) + .getValue(); + return this; + } + + public RoutePolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RoutePolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RoutePolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public RoutePolicyImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public RoutePolicyImpl withConditions(List conditions) { + this.innerModel().withConditions(conditions); + return this; + } + + public RoutePolicyImpl withAnnotation(String annotation) { + this.innerModel().withAnnotation(annotation); + return this; + } + + public RoutePolicyImpl withProperties(Object properties) { + this.updateBody.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/SupportPackagePropertiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/SupportPackagePropertiesImpl.java new file mode 100644 index 000000000000..f2b8d11f48c5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/SupportPackagePropertiesImpl.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.managednetworkfabric.implementation; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner; +import com.azure.resourcemanager.managednetworkfabric.models.SupportPackageProperties; + +public final class SupportPackagePropertiesImpl implements SupportPackageProperties { + private SupportPackagePropertiesInner innerObject; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + SupportPackagePropertiesImpl( + SupportPackagePropertiesInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String supportPackageUrl() { + return this.innerModel().supportPackageUrl(); + } + + public SupportPackagePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/Utils.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/Utils.java new file mode 100644 index 000000000000..a637cb43f9a1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/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.managednetworkfabric.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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/package-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/package-info.java new file mode 100644 index 000000000000..26d9095c3d72 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/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 implementations for AzureNetworkFabricManagementServiceApi. Self service experience for Azure + * Network Fabric API. + */ +package com.azure.resourcemanager.managednetworkfabric.implementation; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java new file mode 100644 index 000000000000..f7b3c7c267ca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of AccessControlList. */ +public interface AccessControlList { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @return the addressFamily value. + */ + AddressFamily addressFamily(); + + /** + * Gets the conditions property: Access Control List conditions. + * + * @return the conditions value. + */ + List conditions(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner object. + * + * @return the inner object. + */ + AccessControlListInner innerModel(); + + /** The entirety of the AccessControlList definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithAddressFamily, + DefinitionStages.WithConditions, + DefinitionStages.WithCreate { + } + /** The AccessControlList definition stages. */ + interface DefinitionStages { + /** The first stage of the AccessControlList definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AccessControlList 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 AccessControlList 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. + */ + WithAddressFamily withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the AccessControlList definition allowing to specify addressFamily. */ + interface WithAddressFamily { + /** + * Specifies the addressFamily property: IP address family. Example: ipv4 | ipv6.. + * + * @param addressFamily IP address family. Example: ipv4 | ipv6. + * @return the next definition stage. + */ + WithConditions withAddressFamily(AddressFamily addressFamily); + } + /** The stage of the AccessControlList definition allowing to specify conditions. */ + interface WithConditions { + /** + * Specifies the conditions property: Access Control List conditions.. + * + * @param conditions Access Control List conditions. + * @return the next definition stage. + */ + WithCreate withConditions(List conditions); + } + /** + * The stage of the AccessControlList 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.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessControlList create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessControlList create(Context context); + } + /** The stage of the AccessControlList 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 AccessControlList definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the AccessControlList resource. + * + * @return the stage of resource update. + */ + AccessControlList.Update update(); + + /** The template for AccessControlList update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAddressFamily, + UpdateStages.WithConditions, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AccessControlList apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AccessControlList apply(Context context); + } + /** The AccessControlList update stages. */ + interface UpdateStages { + /** The stage of the AccessControlList 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); + } + /** The stage of the AccessControlList update allowing to specify addressFamily. */ + interface WithAddressFamily { + /** + * Specifies the addressFamily property: IP address family. Example: ipv4 | ipv6.. + * + * @param addressFamily IP address family. Example: ipv4 | ipv6. + * @return the next definition stage. + */ + Update withAddressFamily(AddressFamily addressFamily); + } + /** The stage of the AccessControlList update allowing to specify conditions. */ + interface WithConditions { + /** + * Specifies the conditions property: Access Control List conditions.. + * + * @param conditions Access Control List conditions. + * @return the next definition stage. + */ + Update withConditionsForUpdate(List conditions); + } + /** The stage of the AccessControlList update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccessControlList refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccessControlList refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java new file mode 100644 index 000000000000..6e18abd08c8b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The AccessControlList patch resource definition. */ +@Fluent +public final class AccessControlListPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private AccessControlListPatchProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of AccessControlListPatch class. */ + public AccessControlListPatch() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private AccessControlListPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 AccessControlListPatch object itself. + */ + public AccessControlListPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @return the addressFamily value. + */ + public AddressFamily addressFamily() { + return this.innerProperties() == null ? null : this.innerProperties().addressFamily(); + } + + /** + * Set the addressFamily property: IP address family. Example: ipv4 | ipv6. + * + * @param addressFamily the addressFamily value to set. + * @return the AccessControlListPatch object itself. + */ + public AccessControlListPatch withAddressFamily(AddressFamily addressFamily) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListPatchProperties(); + } + this.innerProperties().withAddressFamily(addressFamily); + return this; + } + + /** + * Get the conditions property: Access Control List conditions. + * + * @return the conditions value. + */ + public List conditions() { + return this.innerProperties() == null ? null : this.innerProperties().conditions(); + } + + /** + * Set the conditions property: Access Control List conditions. + * + * @param conditions the conditions value to set. + * @return the AccessControlListPatch object itself. + */ + public AccessControlListPatch withConditions(List conditions) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListPatchProperties(); + } + this.innerProperties().withConditions(conditions); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the AccessControlListPatch object itself. + */ + public AccessControlListPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessControlListPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchPropertiesConditionsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchPropertiesConditionsItem.java new file mode 100644 index 000000000000..fca298e22cc0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatchPropertiesConditionsItem.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Access Control List condition model. */ +@Fluent +public final class AccessControlListPatchPropertiesConditionsItem extends AnnotationResource { + /* + * sequenceNumber of the Access Control List. + */ + @JsonProperty(value = "sequenceNumber", required = true) + private int sequenceNumber; + + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action", required = true) + private ConditionActionType action; + + /* + * destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 + */ + @JsonProperty(value = "destinationAddress", required = true) + private String destinationAddress; + + /* + * destinationPort. Example: any | 1253 + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /* + * sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 + */ + @JsonProperty(value = "sourceAddress", required = true) + private String sourceAddress; + + /* + * sourcePort. Example: any | 1253 + */ + @JsonProperty(value = "sourcePort", required = true) + private String sourcePort; + + /* + * TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 | 1. + */ + @JsonProperty(value = "protocol", required = true) + private int protocol; + + /** Creates an instance of AccessControlListPatchPropertiesConditionsItem class. */ + public AccessControlListPatchPropertiesConditionsItem() { + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Access Control List. + * + * @return the sequenceNumber value. + */ + public int sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Access Control List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withSequenceNumber(int sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public ConditionActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withAction(ConditionActionType action) { + this.action = action; + return this; + } + + /** + * Get the destinationAddress property: destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @return the destinationAddress value. + */ + public String destinationAddress() { + return this.destinationAddress; + } + + /** + * Set the destinationAddress property: destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @param destinationAddress the destinationAddress value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + return this; + } + + /** + * Get the destinationPort property: destinationPort. Example: any | 1253. + * + * @return the destinationPort value. + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: destinationPort. Example: any | 1253. + * + * @param destinationPort the destinationPort value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the sourceAddress property: sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @return the sourceAddress value. + */ + public String sourceAddress() { + return this.sourceAddress; + } + + /** + * Set the sourceAddress property: sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @param sourceAddress the sourceAddress value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withSourceAddress(String sourceAddress) { + this.sourceAddress = sourceAddress; + return this; + } + + /** + * Get the sourcePort property: sourcePort. Example: any | 1253. + * + * @return the sourcePort value. + */ + public String sourcePort() { + return this.sourcePort; + } + + /** + * Set the sourcePort property: sourcePort. Example: any | 1253. + * + * @param sourcePort the sourcePort value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withSourcePort(String sourcePort) { + this.sourcePort = sourcePort; + return this; + } + + /** + * Get the protocol property: TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 + * | 1. + * + * @return the protocol value. + */ + public int protocol() { + return this.protocol; + } + + /** + * Set the protocol property: TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 + * | 1. + * + * @param protocol the protocol value to set. + * @return the AccessControlListPatchPropertiesConditionsItem object itself. + */ + public AccessControlListPatchPropertiesConditionsItem withProtocol(int protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListPatchPropertiesConditionsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model AccessControlListPatchPropertiesConditionsItem")); + } + if (destinationAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationAddress in model" + + " AccessControlListPatchPropertiesConditionsItem")); + } + if (destinationPort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model" + + " AccessControlListPatchPropertiesConditionsItem")); + } + if (sourceAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceAddress in model" + + " AccessControlListPatchPropertiesConditionsItem")); + } + if (sourcePort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourcePort in model" + + " AccessControlListPatchPropertiesConditionsItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListPatchPropertiesConditionsItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPropertiesConditionsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPropertiesConditionsItem.java new file mode 100644 index 000000000000..43211873d2f1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPropertiesConditionsItem.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Access Control List condition model. */ +@Fluent +public final class AccessControlListPropertiesConditionsItem extends AnnotationResource { + /* + * sequenceNumber of the Access Control List. + */ + @JsonProperty(value = "sequenceNumber", required = true) + private int sequenceNumber; + + /* + * action. Example: allow | deny. + */ + @JsonProperty(value = "action", required = true) + private ConditionActionType action; + + /* + * destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 + */ + @JsonProperty(value = "destinationAddress", required = true) + private String destinationAddress; + + /* + * destinationPort. Example: any | 1253 + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /* + * sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10 + */ + @JsonProperty(value = "sourceAddress", required = true) + private String sourceAddress; + + /* + * sourcePort. Example: any | 1253 + */ + @JsonProperty(value = "sourcePort", required = true) + private String sourcePort; + + /* + * TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 | 1. + */ + @JsonProperty(value = "protocol", required = true) + private int protocol; + + /** Creates an instance of AccessControlListPropertiesConditionsItem class. */ + public AccessControlListPropertiesConditionsItem() { + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Access Control List. + * + * @return the sequenceNumber value. + */ + public int sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Access Control List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withSequenceNumber(int sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public ConditionActionType action() { + return this.action; + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withAction(ConditionActionType action) { + this.action = action; + return this; + } + + /** + * Get the destinationAddress property: destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @return the destinationAddress value. + */ + public String destinationAddress() { + return this.destinationAddress; + } + + /** + * Set the destinationAddress property: destinationAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @param destinationAddress the destinationAddress value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + return this; + } + + /** + * Get the destinationPort property: destinationPort. Example: any | 1253. + * + * @return the destinationPort value. + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: destinationPort. Example: any | 1253. + * + * @param destinationPort the destinationPort value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the sourceAddress property: sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @return the sourceAddress value. + */ + public String sourceAddress() { + return this.sourceAddress; + } + + /** + * Set the sourceAddress property: sourceAddress. Example: any | 1.1.1.0/24 | 1.1.10.10. + * + * @param sourceAddress the sourceAddress value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withSourceAddress(String sourceAddress) { + this.sourceAddress = sourceAddress; + return this; + } + + /** + * Get the sourcePort property: sourcePort. Example: any | 1253. + * + * @return the sourcePort value. + */ + public String sourcePort() { + return this.sourcePort; + } + + /** + * Set the sourcePort property: sourcePort. Example: any | 1253. + * + * @param sourcePort the sourcePort value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withSourcePort(String sourcePort) { + this.sourcePort = sourcePort; + return this; + } + + /** + * Get the protocol property: TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 + * | 1. + * + * @return the protocol value. + */ + public int protocol() { + return this.protocol; + } + + /** + * Set the protocol property: TCP/IP protocol as defined in the list of IP protocol numbers. Example: 255 (any) | 0 + * | 1. + * + * @param protocol the protocol value to set. + * @return the AccessControlListPropertiesConditionsItem object itself. + */ + public AccessControlListPropertiesConditionsItem withProtocol(int protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListPropertiesConditionsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model AccessControlListPropertiesConditionsItem")); + } + if (destinationAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationAddress in model" + + " AccessControlListPropertiesConditionsItem")); + } + if (destinationPort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model" + + " AccessControlListPropertiesConditionsItem")); + } + if (sourceAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceAddress in model AccessControlListPropertiesConditionsItem")); + } + if (sourcePort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourcePort in model AccessControlListPropertiesConditionsItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListPropertiesConditionsItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlLists.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlLists.java new file mode 100644 index 000000000000..c91c212cfd04 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlLists.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 AccessControlLists. */ +public interface AccessControlLists { + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @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 AccessControlList resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context); + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition. + */ + AccessControlList getByResourceGroup(String resourceGroupName, String accessControlListName); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String accessControlListName, Context context); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accessControlListName Name of the Access Control List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accessControlListName); + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AccessControlLists by resource group. + * + *

Implements AccessControlLists list by resource group GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 AccessControlLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AccessControlLists by subscription. + * + *

Implements AccessControlLists list by subscription GET method. + * + * @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 list of AccessControlLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @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 the AccessControlList resource definition along with {@link Response}. + */ + AccessControlList getById(String id); + + /** + * Gets a Access Control List. + * + *

Implements Access Control List GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AccessControlList resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Access Control List. + * + *

Implements Access Control List DELETE method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AccessControlList resource. + * + * @param name resource name. + * @return the first stage of the new AccessControlList definition. + */ + AccessControlList.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListsListResult.java new file mode 100644 index 000000000000..10bfb3ae2d85 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.AccessControlListInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of AccessControlLists. */ +@Fluent +public final class AccessControlListsListResult { + /* + * List of AccessControlList resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AccessControlListsListResult class. */ + public AccessControlListsListResult() { + } + + /** + * Get the value property: List of AccessControlList resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of AccessControlList resources. + * + * @param value the value value to set. + * @return the AccessControlListsListResult object itself. + */ + public AccessControlListsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the AccessControlListsListResult object itself. + */ + public AccessControlListsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionType.java new file mode 100644 index 000000000000..f52fb048ae53 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionType.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AddressFamily.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AddressFamily.java new file mode 100644 index 000000000000..9ce88b1684ce --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AddressFamily.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** IP address family. Example: ipv4 | ipv6. */ +public final class AddressFamily extends ExpandableStringEnum { + /** Static value ipv4 for AddressFamily. */ + public static final AddressFamily IPV4 = fromString("ipv4"); + + /** Static value ipv6 for AddressFamily. */ + public static final AddressFamily IPV6 = fromString("ipv6"); + + /** + * Creates a new instance of AddressFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AddressFamily() { + } + + /** + * Creates or finds a AddressFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddressFamily. + */ + @JsonCreator + public static AddressFamily fromString(String name) { + return fromString(name, AddressFamily.class); + } + + /** + * Gets known AddressFamily values. + * + * @return known AddressFamily values. + */ + public static Collection values() { + return values(AddressFamily.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdministrativeState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdministrativeState.java new file mode 100644 index 000000000000..0f7bc4365b79 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdministrativeState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Administrative state. */ +public final class AdministrativeState extends ExpandableStringEnum { + /** Static value Enable for AdministrativeState. */ + public static final AdministrativeState ENABLE = fromString("Enable"); + + /** Static value Disable for AdministrativeState. */ + public static final AdministrativeState DISABLE = fromString("Disable"); + + /** + * Creates a new instance of AdministrativeState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdministrativeState() { + } + + /** + * Creates or finds a AdministrativeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdministrativeState. + */ + @JsonCreator + public static AdministrativeState fromString(String name) { + return fromString(name, AdministrativeState.class); + } + + /** + * Gets known AdministrativeState values. + * + * @return known AdministrativeState values. + */ + public static Collection values() { + return values(AdministrativeState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdvertiseBoolean.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdvertiseBoolean.java new file mode 100644 index 000000000000..004ea0f14d2a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdvertiseBoolean.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** noAdvertise. Example: true | false. */ +public final class AdvertiseBoolean extends ExpandableStringEnum { + /** Static value true for AdvertiseBoolean. */ + public static final AdvertiseBoolean TRUE = fromString("true"); + + /** Static value false for AdvertiseBoolean. */ + public static final AdvertiseBoolean FALSE = fromString("false"); + + /** + * Creates a new instance of AdvertiseBoolean value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdvertiseBoolean() { + } + + /** + * Creates or finds a AdvertiseBoolean from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdvertiseBoolean. + */ + @JsonCreator + public static AdvertiseBoolean fromString(String name) { + return fromString(name, AdvertiseBoolean.class); + } + + /** + * Gets known AdvertiseBoolean values. + * + * @return known AdvertiseBoolean values. + */ + public static Collection values() { + return values(AdvertiseBoolean.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AllowASOverride.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AllowASOverride.java new file mode 100644 index 000000000000..4a753704781d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AllowASOverride.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enable Or Disable state. */ +public final class AllowASOverride extends ExpandableStringEnum { + /** Static value Enable for AllowASOverride. */ + public static final AllowASOverride ENABLE = fromString("Enable"); + + /** Static value Disable for AllowASOverride. */ + public static final AllowASOverride DISABLE = fromString("Disable"); + + /** + * Creates a new instance of AllowASOverride value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllowASOverride() { + } + + /** + * Creates or finds a AllowASOverride from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowASOverride. + */ + @JsonCreator + public static AllowASOverride fromString(String name) { + return fromString(name, AllowASOverride.class); + } + + /** + * Gets known AllowASOverride values. + * + * @return known AllowASOverride values. + */ + public static Collection values() { + return values(AllowASOverride.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AnnotationResource.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AnnotationResource.java new file mode 100644 index 000000000000..0bc7c1be4f3a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AnnotationResource.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Switch configuration entries require a description to discern between configuration groups. */ +@Fluent +public class AnnotationResource { + /* + * Switch configuration description. + */ + @JsonProperty(value = "annotation") + private String annotation; + + /** Creates an instance of AnnotationResource class. */ + public AnnotationResource() { + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.annotation; + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the AnnotationResource object itself. + */ + public AnnotationResource withAnnotation(String annotation) { + this.annotation = annotation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ArpProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ArpProperties.java new file mode 100644 index 000000000000..2ebcca3f52d0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ArpProperties.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ArpPropertiesInner; + +/** An immutable client-side representation of ArpProperties. */ +public interface ArpProperties { + /** + * Gets the address property: Ipv4 or Ipv6 address. + * + * @return the address value. + */ + String address(); + + /** + * Gets the age property: Duration in seconds. + * + * @return the age value. + */ + String age(); + + /** + * Gets the macAddress property: Hardware address. + * + * @return the macAddress value. + */ + String macAddress(); + + /** + * Gets the interfaceProperty property: Layer 2 interface name. + * + * @return the interfaceProperty value. + */ + String interfaceProperty(); + + /** + * Gets the state property: ARP status. + * + * @return the state value. + */ + String state(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.ArpPropertiesInner object. + * + * @return the inner object. + */ + ArpPropertiesInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BfdConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BfdConfiguration.java new file mode 100644 index 000000000000..3fdbc2e8e537 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BfdConfiguration.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BFD configuration properties. */ +@Immutable +public final class BfdConfiguration { + /* + * Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * interval in milliseconds. Example: 300. + */ + @JsonProperty(value = "interval", access = JsonProperty.Access.WRITE_ONLY) + private Integer interval; + + /* + * Multiplier for the Bfd Configuration. Example: 3. + */ + @JsonProperty(value = "multiplier", access = JsonProperty.Access.WRITE_ONLY) + private Integer multiplier; + + /** Creates an instance of BfdConfiguration class. */ + public BfdConfiguration() { + } + + /** + * Get the administrativeState property: Administrative state of the BfdConfiguration. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the interval property: interval in milliseconds. Example: 300. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Get the multiplier property: Multiplier for the Bfd Configuration. Example: 3. + * + * @return the multiplier value. + */ + public Integer multiplier() { + return this.multiplier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BooleanEnumProperty.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BooleanEnumProperty.java new file mode 100644 index 000000000000..ee0306982d17 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BooleanEnumProperty.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Boolean Enum. Example- True/False. */ +public final class BooleanEnumProperty extends ExpandableStringEnum { + /** Static value True for BooleanEnumProperty. */ + public static final BooleanEnumProperty TRUE = fromString("True"); + + /** Static value False for BooleanEnumProperty. */ + public static final BooleanEnumProperty FALSE = fromString("False"); + + /** + * Creates a new instance of BooleanEnumProperty value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BooleanEnumProperty() { + } + + /** + * Creates or finds a BooleanEnumProperty from its string representation. + * + * @param name a name to look for. + * @return the corresponding BooleanEnumProperty. + */ + @JsonCreator + public static BooleanEnumProperty fromString(String name) { + return fromString(name, BooleanEnumProperty.class); + } + + /** + * Gets known BooleanEnumProperty values. + * + * @return known BooleanEnumProperty values. + */ + public static Collection values() { + return values(BooleanEnumProperty.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionType.java new file mode 100644 index 000000000000..f28a55a428e8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** action. Example: allow | deny. */ +public final class CommunityActionType extends ExpandableStringEnum { + /** Static value allow for CommunityActionType. */ + public static final CommunityActionType ALLOW = fromString("allow"); + + /** Static value deny for CommunityActionType. */ + public static final CommunityActionType DENY = fromString("deny"); + + /** + * Creates a new instance of CommunityActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommunityActionType() { + } + + /** + * Creates or finds a CommunityActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommunityActionType. + */ + @JsonCreator + public static CommunityActionType fromString(String name) { + return fromString(name, CommunityActionType.class); + } + + /** + * Gets known CommunityActionType values. + * + * @return known CommunityActionType values. + */ + public static Collection values() { + return values(CommunityActionType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet.java new file mode 100644 index 000000000000..3fe9e1736b77 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet model. */ +@Fluent +public final class Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet { + /* + * Route policy set manipulations. + */ + @JsonProperty(value = "set") + private RoutePolicyPropertiesConditionsProperties set; + + /** + * Creates an instance of + * Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet class. + */ + public Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet() { + } + + /** + * Get the set property: Route policy set manipulations. + * + * @return the set value. + */ + public RoutePolicyPropertiesConditionsProperties set() { + return this.set; + } + + /** + * Set the set property: Route policy set manipulations. + * + * @param set the set value to set. + * @return the Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet + * object itself. + */ + public Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet withSet( + RoutePolicyPropertiesConditionsProperties set) { + this.set = set; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (set() != null) { + set().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConditionActionType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConditionActionType.java new file mode 100644 index 000000000000..bfd3b6d8f8b8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConditionActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** action. Example: allow | deny. */ +public final class ConditionActionType extends ExpandableStringEnum { + /** Static value allow for ConditionActionType. */ + public static final ConditionActionType ALLOW = fromString("allow"); + + /** Static value deny for ConditionActionType. */ + public static final ConditionActionType DENY = fromString("deny"); + + /** + * Creates a new instance of ConditionActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConditionActionType() { + } + + /** + * Creates or finds a ConditionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConditionActionType. + */ + @JsonCreator + public static ConditionActionType fromString(String name) { + return fromString(name, ConditionActionType.class); + } + + /** + * Gets known ConditionActionType values. + * + * @return known ConditionActionType values. + */ + public static Collection values() { + return values(ConditionActionType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnableDisableOnResources.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnableDisableOnResources.java new file mode 100644 index 000000000000..bbb8882d691d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnableDisableOnResources.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update administrative state on list of resources. */ +@Fluent +public class EnableDisableOnResources { + /* + * Network Fabrics or Network Rack resource Id. + */ + @JsonProperty(value = "resourceIds") + private List resourceIds; + + /** Creates an instance of EnableDisableOnResources class. */ + public EnableDisableOnResources() { + } + + /** + * Get the resourceIds property: Network Fabrics or Network Rack resource Id. + * + * @return the resourceIds value. + */ + public List resourceIds() { + return this.resourceIds; + } + + /** + * Set the resourceIds property: Network Fabrics or Network Rack resource Id. + * + * @param resourceIds the resourceIds value to set. + * @return the EnableDisableOnResources object itself. + */ + public EnableDisableOnResources withResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnabledDisabledState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnabledDisabledState.java new file mode 100644 index 000000000000..7740d960e2eb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnabledDisabledState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** EnabledDisabledState state for the resource. */ +public final class EnabledDisabledState extends ExpandableStringEnum { + /** Static value Enabled for EnabledDisabledState. */ + public static final EnabledDisabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnabledDisabledState. */ + public static final EnabledDisabledState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EnabledDisabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnabledDisabledState() { + } + + /** + * Creates or finds a EnabledDisabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledDisabledState. + */ + @JsonCreator + public static EnabledDisabledState fromString(String name) { + return fromString(name, EnabledDisabledState.class); + } + + /** + * Gets known EnabledDisabledState values. + * + * @return known EnabledDisabledState values. + */ + public static Collection values() { + return values(EnabledDisabledState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExportBoolean.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExportBoolean.java new file mode 100644 index 000000000000..d02b0d44e7c2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExportBoolean.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** noExport. Example: true | false. */ +public final class ExportBoolean extends ExpandableStringEnum { + /** Static value true for ExportBoolean. */ + public static final ExportBoolean TRUE = fromString("true"); + + /** Static value false for ExportBoolean. */ + public static final ExportBoolean FALSE = fromString("false"); + + /** + * Creates a new instance of ExportBoolean value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExportBoolean() { + } + + /** + * Creates or finds a ExportBoolean from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportBoolean. + */ + @JsonCreator + public static ExportBoolean fromString(String name) { + return fromString(name, ExportBoolean.class); + } + + /** + * Gets known ExportBoolean values. + * + * @return known ExportBoolean values. + */ + public static Collection values() { + return values(ExportBoolean.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExpressRouteConnectionInformation.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExpressRouteConnectionInformation.java new file mode 100644 index 000000000000..57e252411107 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExpressRouteConnectionInformation.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ExpressRoute circuit ID and the Auth Key are required for you to successfully deploy NFC service. */ +@Fluent +public final class ExpressRouteConnectionInformation { + /* + * The express route circuit Azure resource ID, must be of type Microsoft.Network/expressRouteCircuits/circuitName. + * The ExpressRoute Circuit is a mandatory attribute. + */ + @JsonProperty(value = "expressRouteCircuitId", required = true) + private String expressRouteCircuitId; + + /* + * Authorization key for the circuit, must be of type Microsoft.Network/expressRouteCircuits/authorizations. The + * Auth Key is a mandatory attribute. + */ + @JsonProperty(value = "expressRouteAuthorizationKey", required = true) + private String expressRouteAuthorizationKey; + + /** Creates an instance of ExpressRouteConnectionInformation class. */ + public ExpressRouteConnectionInformation() { + } + + /** + * Get the expressRouteCircuitId property: The express route circuit Azure resource ID, must be of type + * Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory attribute. + * + * @return the expressRouteCircuitId value. + */ + public String expressRouteCircuitId() { + return this.expressRouteCircuitId; + } + + /** + * Set the expressRouteCircuitId property: The express route circuit Azure resource ID, must be of type + * Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory attribute. + * + * @param expressRouteCircuitId the expressRouteCircuitId value to set. + * @return the ExpressRouteConnectionInformation object itself. + */ + public ExpressRouteConnectionInformation withExpressRouteCircuitId(String expressRouteCircuitId) { + this.expressRouteCircuitId = expressRouteCircuitId; + return this; + } + + /** + * Get the expressRouteAuthorizationKey property: Authorization key for the circuit, must be of type + * Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. + * + * @return the expressRouteAuthorizationKey value. + */ + public String expressRouteAuthorizationKey() { + return this.expressRouteAuthorizationKey; + } + + /** + * Set the expressRouteAuthorizationKey property: Authorization key for the circuit, must be of type + * Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute. + * + * @param expressRouteAuthorizationKey the expressRouteAuthorizationKey value to set. + * @return the ExpressRouteConnectionInformation object itself. + */ + public ExpressRouteConnectionInformation withExpressRouteAuthorizationKey(String expressRouteAuthorizationKey) { + this.expressRouteAuthorizationKey = expressRouteAuthorizationKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expressRouteCircuitId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property expressRouteCircuitId in model ExpressRouteConnectionInformation")); + } + if (expressRouteAuthorizationKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property expressRouteAuthorizationKey in model" + + " ExpressRouteConnectionInformation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteConnectionInformation.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java new file mode 100644 index 000000000000..0195073d7e6f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; +import java.util.List; + +/** An immutable client-side representation of ExternalNetwork. */ +public interface ExternalNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. + * + * @return the networkToNetworkInterconnectId value. + */ + String networkToNetworkInterconnectId(); + + /** + * Gets the disabledOnResources property: List of resources the externalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + List disabledOnResources(); + + /** + * Gets the administrativeState property: AdministrativeState of the externalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + PeeringOption peeringOption(); + + /** + * Gets the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + OptionBProperties optionBProperties(); + + /** + * Gets the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + ExternalNetworkPropertiesOptionAProperties optionAProperties(); + + /** + * Gets the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + String importRoutePolicyId(); + + /** + * Gets the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + String exportRoutePolicyId(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner object. + * + * @return the inner object. + */ + ExternalNetworkInner innerModel(); + + /** The entirety of the ExternalNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithPeeringOption, + DefinitionStages.WithCreate { + } + /** The ExternalNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the ExternalNetwork definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExternalNetwork definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, l3IsolationDomainName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @return the next definition stage. + */ + WithPeeringOption withExistingL3IsolationDomain(String resourceGroupName, String l3IsolationDomainName); + } + /** The stage of the ExternalNetwork definition allowing to specify peeringOption. */ + interface WithPeeringOption { + /** + * Specifies the peeringOption property: Peering option list.. + * + * @param peeringOption Peering option list. + * @return the next definition stage. + */ + WithCreate withPeeringOption(PeeringOption peeringOption); + } + /** + * The stage of the ExternalNetwork 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.WithOptionBProperties, + DefinitionStages.WithOptionAProperties, + DefinitionStages.WithImportRoutePolicyId, + DefinitionStages.WithExportRoutePolicyId, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExternalNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExternalNetwork create(Context context); + } + /** The stage of the ExternalNetwork definition allowing to specify optionBProperties. */ + interface WithOptionBProperties { + /** + * Specifies the optionBProperties property: option B properties object. + * + * @param optionBProperties option B properties object. + * @return the next definition stage. + */ + WithCreate withOptionBProperties(OptionBProperties optionBProperties); + } + /** The stage of the ExternalNetwork definition allowing to specify optionAProperties. */ + interface WithOptionAProperties { + /** + * Specifies the optionAProperties property: option A properties object. + * + * @param optionAProperties option A properties object. + * @return the next definition stage. + */ + WithCreate withOptionAProperties(ExternalNetworkPropertiesOptionAProperties optionAProperties); + } + /** The stage of the ExternalNetwork definition allowing to specify importRoutePolicyId. */ + interface WithImportRoutePolicyId { + /** + * Specifies the importRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param importRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + WithCreate withImportRoutePolicyId(String importRoutePolicyId); + } + /** The stage of the ExternalNetwork definition allowing to specify exportRoutePolicyId. */ + interface WithExportRoutePolicyId { + /** + * Specifies the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy.. + * + * @param exportRoutePolicyId ARM resource ID of exportRoutePolicy. + * @return the next definition stage. + */ + WithCreate withExportRoutePolicyId(String exportRoutePolicyId); + } + /** The stage of the ExternalNetwork definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the ExternalNetwork resource. + * + * @return the stage of resource update. + */ + ExternalNetwork.Update update(); + + /** The template for ExternalNetwork update. */ + interface Update + extends UpdateStages.WithPeeringOption, + UpdateStages.WithOptionBProperties, + UpdateStages.WithOptionAProperties, + UpdateStages.WithImportRoutePolicyId, + UpdateStages.WithExportRoutePolicyId, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExternalNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExternalNetwork apply(Context context); + } + /** The ExternalNetwork update stages. */ + interface UpdateStages { + /** The stage of the ExternalNetwork update allowing to specify peeringOption. */ + interface WithPeeringOption { + /** + * Specifies the peeringOption property: Peering option list.. + * + * @param peeringOption Peering option list. + * @return the next definition stage. + */ + Update withPeeringOption(PeeringOption peeringOption); + } + /** The stage of the ExternalNetwork update allowing to specify optionBProperties. */ + interface WithOptionBProperties { + /** + * Specifies the optionBProperties property: option B properties object. + * + * @param optionBProperties option B properties object. + * @return the next definition stage. + */ + Update withOptionBProperties(OptionBProperties optionBProperties); + } + /** The stage of the ExternalNetwork update allowing to specify optionAProperties. */ + interface WithOptionAProperties { + /** + * Specifies the optionAProperties property: option A properties object. + * + * @param optionAProperties option A properties object. + * @return the next definition stage. + */ + Update withOptionAProperties(OptionAProperties optionAProperties); + } + /** The stage of the ExternalNetwork update allowing to specify importRoutePolicyId. */ + interface WithImportRoutePolicyId { + /** + * Specifies the importRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param importRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + Update withImportRoutePolicyId(String importRoutePolicyId); + } + /** The stage of the ExternalNetwork update allowing to specify exportRoutePolicyId. */ + interface WithExportRoutePolicyId { + /** + * Specifies the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy.. + * + * @param exportRoutePolicyId ARM resource ID of exportRoutePolicy. + * @return the next definition stage. + */ + Update withExportRoutePolicyId(String exportRoutePolicyId); + } + /** The stage of the ExternalNetwork update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExternalNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExternalNetwork refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState(UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param body Request payload. + * @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 updateAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState(UpdateAdministrativeState body); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param body Request payload. + * @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 updateBgpAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState(UpdateAdministrativeState body); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors(EnableDisableOnResources body); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param body Request payload. + * @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 clearIpv6Neighbors(EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries(EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param body Request payload. + * @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 clearArpEntries(EnableDisableOnResources body, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatch.java new file mode 100644 index 000000000000..a40e011c114e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatch.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkPatchProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ExternalNetwork patch resource definition. */ +@Fluent +public final class ExternalNetworkPatch { + /* + * External Network Patch properties. + */ + @JsonProperty(value = "properties") + private ExternalNetworkPatchProperties innerProperties; + + /** Creates an instance of ExternalNetworkPatch class. */ + public ExternalNetworkPatch() { + } + + /** + * Get the innerProperties property: External Network Patch properties. + * + * @return the innerProperties value. + */ + private ExternalNetworkPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.innerProperties() == null ? null : this.innerProperties().peeringOption(); + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withPeeringOption(PeeringOption peeringOption) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withPeeringOption(peeringOption); + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBProperties optionBProperties() { + return this.innerProperties() == null ? null : this.innerProperties().optionBProperties(); + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withOptionBProperties(OptionBProperties optionBProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withOptionBProperties(optionBProperties); + return this; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public OptionAProperties optionAProperties() { + return this.innerProperties() == null ? null : this.innerProperties().optionAProperties(); + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withOptionAProperties(OptionAProperties optionAProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withOptionAProperties(optionAProperties); + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().importRoutePolicyId(); + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withImportRoutePolicyId(String importRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withImportRoutePolicyId(importRoutePolicyId); + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().exportRoutePolicyId(); + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withExportRoutePolicyId(String exportRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the ExternalNetworkPatch object itself. + */ + public ExternalNetworkPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new ExternalNetworkPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatchableProperties.java new file mode 100644 index 000000000000..f90fa278cb8d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatchableProperties.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ExternalNetwork patchable properties. */ +@Fluent +public class ExternalNetworkPatchableProperties { + /* + * Peering option list. + */ + @JsonProperty(value = "peeringOption") + private PeeringOption peeringOption; + + /* + * option B properties object + */ + @JsonProperty(value = "optionBProperties") + private OptionBProperties optionBProperties; + + /* + * option A properties object + */ + @JsonProperty(value = "optionAProperties") + private OptionAProperties optionAProperties; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of exportRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of ExternalNetworkPatchableProperties class. */ + public ExternalNetworkPatchableProperties() { + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.peeringOption; + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the ExternalNetworkPatchableProperties object itself. + */ + public ExternalNetworkPatchableProperties withPeeringOption(PeeringOption peeringOption) { + this.peeringOption = peeringOption; + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBProperties optionBProperties() { + return this.optionBProperties; + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the ExternalNetworkPatchableProperties object itself. + */ + public ExternalNetworkPatchableProperties withOptionBProperties(OptionBProperties optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public OptionAProperties optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the ExternalNetworkPatchableProperties object itself. + */ + public ExternalNetworkPatchableProperties withOptionAProperties(OptionAProperties optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the ExternalNetworkPatchableProperties object itself. + */ + public ExternalNetworkPatchableProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the ExternalNetworkPatchableProperties object itself. + */ + public ExternalNetworkPatchableProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (optionBProperties() != null) { + optionBProperties().validate(); + } + if (optionAProperties() != null) { + optionAProperties().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPropertiesOptionAProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPropertiesOptionAProperties.java new file mode 100644 index 000000000000..52581c4c9613 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPropertiesOptionAProperties.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; + +/** option A properties object. */ +@Fluent +public final class ExternalNetworkPropertiesOptionAProperties extends OptionAProperties { + /** Creates an instance of ExternalNetworkPropertiesOptionAProperties class. */ + public ExternalNetworkPropertiesOptionAProperties() { + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withMtu(Integer mtu) { + super.withMtu(mtu); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withVlanId(Integer vlanId) { + super.withVlanId(vlanId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withPeerAsn(Integer peerAsn) { + super.withPeerAsn(peerAsn); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withBfdConfiguration(BfdConfiguration bfdConfiguration) { + super.withBfdConfiguration(bfdConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public ExternalNetworkPropertiesOptionAProperties withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + super.withSecondaryIpv6Prefix(secondaryIpv6Prefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworks.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworks.java new file mode 100644 index 000000000000..86531b09ef27 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworks.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 ExternalNetworks. */ +public interface ExternalNetworks { + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @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 defines the ExternalNetwork item along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String externalNetworkName, Context context); + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the ExternalNetwork item. + */ + ExternalNetwork get(String resourceGroupName, String l3IsolationDomainName, String externalNetworkName); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName, String externalNetworkName); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @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 l3IsolationDomainName, String externalNetworkName, Context context); + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 ExternalNetworks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String l3IsolationDomainName); + + /** + * Executes list operation to display External Networks within an isolation domain. + * + *

Implements External Networks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @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 list of ExternalNetworks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Executes update operation to enable or disable administrative State for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes BGP state update operation to the underlying resources. + * + *

Update BGP for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body); + + /** + * Execute BfdForBgp update operation to the underlying resources. + * + *

Update BfdForBgp for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearIpv6Neighbors table operation to the underlying resources. + * + *

clearIpv6Neighbors for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearArpEntries for externalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param externalNetworkName Name of the ExternalNetwork. + * @param body Request payload. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String externalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @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 defines the ExternalNetwork item along with {@link Response}. + */ + ExternalNetwork getById(String id); + + /** + * Retrieves details of ExternalNetwork. + * + *

Implements ExternalNetworks GET method. + * + * @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 defines the ExternalNetwork item along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a ExternalNetworks. + * + *

Implements ExternalNetworks DELETE method. + * + * @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 ExternalNetwork resource. + * + * @param name resource name. + * @return the first stage of the new ExternalNetwork definition. + */ + ExternalNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworksList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworksList.java new file mode 100644 index 000000000000..b39c73626dca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworksList.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.ExternalNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ExternalNetworks. */ +@Fluent +public final class ExternalNetworksList { + /* + * List of ExternalNetworks resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ExternalNetworksList class. */ + public ExternalNetworksList() { + } + + /** + * Get the value property: List of ExternalNetworks resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of ExternalNetworks resources. + * + * @param value the value value to set. + * @return the ExternalNetworksList object itself. + */ + public ExternalNetworksList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the ExternalNetworksList object itself. + */ + public ExternalNetworksList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDeviceStatusProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDeviceStatusProperties.java new file mode 100644 index 000000000000..b6e8ee4f57fe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDeviceStatusProperties.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.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner; + +/** An immutable client-side representation of GetDeviceStatusProperties. */ +public interface GetDeviceStatusProperties { + /** + * Gets the operationalStatus property: Primary or Secondary power end. + * + * @return the operationalStatus value. + */ + OperationalStatus operationalStatus(); + + /** + * Gets the powerCycleState property: On or Off power cycle state. + * + * @return the powerCycleState value. + */ + PowerCycleState powerCycleState(); + + /** + * Gets the serialNumber property: The serial number of the device. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDeviceStatusPropertiesInner + * object. + * + * @return the inner object. + */ + GetDeviceStatusPropertiesInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDynamicInterfaceMapsPropertiesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDynamicInterfaceMapsPropertiesItem.java new file mode 100644 index 000000000000..ce8d58537383 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDynamicInterfaceMapsPropertiesItem.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner; + +/** An immutable client-side representation of GetDynamicInterfaceMapsPropertiesItem. */ +public interface GetDynamicInterfaceMapsPropertiesItem { + /** + * Gets the administrativeState property: The interface administrative state. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the operationalStatus property: The interface operational status. + * + * @return the operationalStatus value. + */ + String operationalStatus(); + + /** + * Gets the phyStatus property: The physical status. + * + * @return the phyStatus value. + */ + String phyStatus(); + + /** + * Gets the transceiverStatus property: The interface transceiver type. Example: up or down. + * + * @return the transceiverStatus value. + */ + String transceiverStatus(); + + /** + * Gets the connectedTo property: Connected to ARM resource or external interface. + * + * @return the connectedTo value. + */ + String connectedTo(); + + /** + * Gets the name property: The interface name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner + * com.azure.resourcemanager.managednetworkfabric.fluent.models.GetDynamicInterfaceMapsPropertiesItemInner object. + * + * @return the inner object. + */ + GetDynamicInterfaceMapsPropertiesItemInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetStaticInterfaceMapsPropertiesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetStaticInterfaceMapsPropertiesItem.java new file mode 100644 index 000000000000..8b1a06e857f4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetStaticInterfaceMapsPropertiesItem.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner; + +/** An immutable client-side representation of GetStaticInterfaceMapsPropertiesItem. */ +public interface GetStaticInterfaceMapsPropertiesItem { + /** + * Gets the name property: The interface name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the description property: The interface description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the identifier property: The interface identifier. + * + * @return the identifier value. + */ + String identifier(); + + /** + * Gets the interfaceType property: The interface type. Example: Ethernet. + * + * @return the interfaceType value. + */ + String interfaceType(); + + /** + * Gets the connectorType property: The physical cable connector type. Example: Optical. + * + * @return the connectorType value. + */ + String connectorType(); + + /** + * Gets the connectedTo property: Connected to ARM resource or external interface. + * + * @return the connectedTo value. + */ + String connectedTo(); + + /** + * Gets the speed property: The interface speed. Example: 100. + * + * @return the speed value. + */ + Float speed(); + + /** + * Gets the channelGroupId property: The port channel group id. + * + * @return the channelGroupId value. + */ + Float channelGroupId(); + + /** + * Gets the inner + * com.azure.resourcemanager.managednetworkfabric.fluent.models.GetStaticInterfaceMapsPropertiesItemInner object. + * + * @return the inner object. + */ + GetStaticInterfaceMapsPropertiesItemInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GshutBoolean.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GshutBoolean.java new file mode 100644 index 000000000000..ae3545f5d8fd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GshutBoolean.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Graceful Shutdown (GSHUT). Example: true | false. */ +public final class GshutBoolean extends ExpandableStringEnum { + /** Static value true for GshutBoolean. */ + public static final GshutBoolean TRUE = fromString("true"); + + /** Static value false for GshutBoolean. */ + public static final GshutBoolean FALSE = fromString("false"); + + /** + * Creates a new instance of GshutBoolean value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GshutBoolean() { + } + + /** + * Creates or finds a GshutBoolean from its string representation. + * + * @param name a name to look for. + * @return the corresponding GshutBoolean. + */ + @JsonCreator + public static GshutBoolean fromString(String name) { + return fromString(name, GshutBoolean.class); + } + + /** + * Gets known GshutBoolean values. + * + * @return known GshutBoolean values. + */ + public static Collection values() { + return values(GshutBoolean.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceStatus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceStatus.java new file mode 100644 index 000000000000..62e6f3062f31 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InterfaceStatusInner; + +/** An immutable client-side representation of InterfaceStatus. */ +public interface InterfaceStatus { + /** + * Gets the administrativeState property: The interface administrative state. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the operationalStatus property: The interface operational status. + * + * @return the operationalStatus value. + */ + String operationalStatus(); + + /** + * Gets the phyStatus property: The physical status. + * + * @return the phyStatus value. + */ + String phyStatus(); + + /** + * Gets the transceiverStatus property: The interface transceiver type. Example: up or down. + * + * @return the transceiverStatus value. + */ + String transceiverStatus(); + + /** + * Gets the connectedTo property: Connected to ARM resource or external interface. + * + * @return the connectedTo value. + */ + String connectedTo(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.InterfaceStatusInner object. + * + * @return the inner object. + */ + InterfaceStatusInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceType.java new file mode 100644 index 000000000000..3ec53f63efa2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The Interface Type. Example: Management/Data. */ +public final class InterfaceType extends ExpandableStringEnum { + /** Static value Management for InterfaceType. */ + public static final InterfaceType MANAGEMENT = fromString("Management"); + + /** Static value Data for InterfaceType. */ + public static final InterfaceType DATA = fromString("Data"); + + /** + * Creates a new instance of InterfaceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InterfaceType() { + } + + /** + * Creates or finds a InterfaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InterfaceType. + */ + @JsonCreator + public static InterfaceType fromString(String name) { + return fromString(name, InterfaceType.class); + } + + /** + * Gets known InterfaceType values. + * + * @return known InterfaceType values. + */ + public static Collection values() { + return values(InterfaceType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetwork.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetwork.java new file mode 100644 index 000000000000..d8a79e101d17 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetwork.java @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; +import java.util.List; + +/** An immutable client-side representation of InternalNetwork. */ +public interface InternalNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the disabledOnResources property: List of resources the InternalNetwork is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + List disabledOnResources(); + + /** + * Gets the administrativeState property: Administrative state of the InternalNetwork. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the bgpDisabledOnResources property: List of resources the BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bgpDisabledOnResources value. + */ + List bgpDisabledOnResources(); + + /** + * Gets the bfdDisabledOnResources property: List of resources the BFD for BGP is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the bfdDisabledOnResources value. + */ + List bfdDisabledOnResources(); + + /** + * Gets the bfdForStaticRoutesDisabledOnResources property: List of resources the BFD of StaticRoutes is disabled + * on. Can be either entire NetworkFabric or NetworkRack. + * + * @return the bfdForStaticRoutesDisabledOnResources value. + */ + List bfdForStaticRoutesDisabledOnResources(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vlanId property: Vlan identifier. Example: 1001. + * + * @return the vlanId value. + */ + int vlanId(); + + /** + * Gets the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + Integer mtu(); + + /** + * Gets the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + List connectedIPv4Subnets(); + + /** + * Gets the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + List connectedIPv6Subnets(); + + /** + * Gets the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration(); + + /** + * Gets the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration(); + + /** + * Gets the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + String importRoutePolicyId(); + + /** + * Gets the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + String exportRoutePolicyId(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner object. + * + * @return the inner object. + */ + InternalNetworkInner innerModel(); + + /** The entirety of the InternalNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithVlanId, + DefinitionStages.WithCreate { + } + /** The InternalNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the InternalNetwork definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the InternalNetwork definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, l3IsolationDomainName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @return the next definition stage. + */ + WithVlanId withExistingL3IsolationDomain(String resourceGroupName, String l3IsolationDomainName); + } + /** The stage of the InternalNetwork definition allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: Vlan identifier. Example: 1001.. + * + * @param vlanId Vlan identifier. Example: 1001. + * @return the next definition stage. + */ + WithCreate withVlanId(int vlanId); + } + /** + * The stage of the InternalNetwork 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.WithMtu, + DefinitionStages.WithConnectedIPv4Subnets, + DefinitionStages.WithConnectedIPv6Subnets, + DefinitionStages.WithStaticRouteConfiguration, + DefinitionStages.WithBgpConfiguration, + DefinitionStages.WithImportRoutePolicyId, + DefinitionStages.WithExportRoutePolicyId, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + InternalNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + InternalNetwork create(Context context); + } + /** The stage of the InternalNetwork definition allowing to specify mtu. */ + interface WithMtu { + /** + * Specifies the mtu property: Maximum transmission unit. Default value is 1500.. + * + * @param mtu Maximum transmission unit. Default value is 1500. + * @return the next definition stage. + */ + WithCreate withMtu(Integer mtu); + } + /** The stage of the InternalNetwork definition allowing to specify connectedIPv4Subnets. */ + interface WithConnectedIPv4Subnets { + /** + * Specifies the connectedIPv4Subnets property: List with object connectedIPv4Subnets.. + * + * @param connectedIPv4Subnets List with object connectedIPv4Subnets. + * @return the next definition stage. + */ + WithCreate withConnectedIPv4Subnets( + List connectedIPv4Subnets); + } + /** The stage of the InternalNetwork definition allowing to specify connectedIPv6Subnets. */ + interface WithConnectedIPv6Subnets { + /** + * Specifies the connectedIPv6Subnets property: List with object connectedIPv6Subnets.. + * + * @param connectedIPv6Subnets List with object connectedIPv6Subnets. + * @return the next definition stage. + */ + WithCreate withConnectedIPv6Subnets( + List connectedIPv6Subnets); + } + /** The stage of the InternalNetwork definition allowing to specify staticRouteConfiguration. */ + interface WithStaticRouteConfiguration { + /** + * Specifies the staticRouteConfiguration property: staticRouteConfiguration model.. + * + * @param staticRouteConfiguration staticRouteConfiguration model. + * @return the next definition stage. + */ + WithCreate withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration); + } + /** The stage of the InternalNetwork definition allowing to specify bgpConfiguration. */ + interface WithBgpConfiguration { + /** + * Specifies the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration BGP configuration properties. + * @return the next definition stage. + */ + WithCreate withBgpConfiguration(InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration); + } + /** The stage of the InternalNetwork definition allowing to specify importRoutePolicyId. */ + interface WithImportRoutePolicyId { + /** + * Specifies the importRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param importRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + WithCreate withImportRoutePolicyId(String importRoutePolicyId); + } + /** The stage of the InternalNetwork definition allowing to specify exportRoutePolicyId. */ + interface WithExportRoutePolicyId { + /** + * Specifies the exportRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param exportRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + WithCreate withExportRoutePolicyId(String exportRoutePolicyId); + } + /** The stage of the InternalNetwork definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the InternalNetwork resource. + * + * @return the stage of resource update. + */ + InternalNetwork.Update update(); + + /** The template for InternalNetwork update. */ + interface Update + extends UpdateStages.WithMtu, + UpdateStages.WithConnectedIPv4Subnets, + UpdateStages.WithConnectedIPv6Subnets, + UpdateStages.WithStaticRouteConfiguration, + UpdateStages.WithBgpConfiguration, + UpdateStages.WithImportRoutePolicyId, + UpdateStages.WithExportRoutePolicyId, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + InternalNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + InternalNetwork apply(Context context); + } + /** The InternalNetwork update stages. */ + interface UpdateStages { + /** The stage of the InternalNetwork update allowing to specify mtu. */ + interface WithMtu { + /** + * Specifies the mtu property: Maximum transmission unit. Default value is 1500.. + * + * @param mtu Maximum transmission unit. Default value is 1500. + * @return the next definition stage. + */ + Update withMtu(Integer mtu); + } + /** The stage of the InternalNetwork update allowing to specify connectedIPv4Subnets. */ + interface WithConnectedIPv4Subnets { + /** + * Specifies the connectedIPv4Subnets property: List with object connectedIPv4Subnets.. + * + * @param connectedIPv4Subnets List with object connectedIPv4Subnets. + * @return the next definition stage. + */ + Update withConnectedIPv4Subnets( + List connectedIPv4Subnets); + } + /** The stage of the InternalNetwork update allowing to specify connectedIPv6Subnets. */ + interface WithConnectedIPv6Subnets { + /** + * Specifies the connectedIPv6Subnets property: List with object connectedIPv6Subnets.. + * + * @param connectedIPv6Subnets List with object connectedIPv6Subnets. + * @return the next definition stage. + */ + Update withConnectedIPv6Subnets( + List connectedIPv6Subnets); + } + /** The stage of the InternalNetwork update allowing to specify staticRouteConfiguration. */ + interface WithStaticRouteConfiguration { + /** + * Specifies the staticRouteConfiguration property: staticRouteConfiguration model.. + * + * @param staticRouteConfiguration staticRouteConfiguration model. + * @return the next definition stage. + */ + Update withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration); + } + /** The stage of the InternalNetwork update allowing to specify bgpConfiguration. */ + interface WithBgpConfiguration { + /** + * Specifies the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration BGP configuration properties. + * @return the next definition stage. + */ + Update withBgpConfiguration(InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration); + } + /** The stage of the InternalNetwork update allowing to specify importRoutePolicyId. */ + interface WithImportRoutePolicyId { + /** + * Specifies the importRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param importRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + Update withImportRoutePolicyId(String importRoutePolicyId); + } + /** The stage of the InternalNetwork update allowing to specify exportRoutePolicyId. */ + interface WithExportRoutePolicyId { + /** + * Specifies the exportRoutePolicyId property: ARM resource ID of importRoutePolicy.. + * + * @param exportRoutePolicyId ARM resource ID of importRoutePolicy. + * @return the next definition stage. + */ + Update withExportRoutePolicyId(String exportRoutePolicyId); + } + /** The stage of the InternalNetwork update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + InternalNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + InternalNetwork refresh(Context context); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState(UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param body Request payload. + * @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 updateAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState(UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param body Request payload. + * @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 updateBgpAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState(UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors(EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param body Request payload. + * @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 clearIpv6Neighbors(EnableDisableOnResources body, Context context); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries(EnableDisableOnResources body); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param body Request payload. + * @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 clearArpEntries(EnableDisableOnResources body, Context context); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForStaticRouteAdministrativeState(UpdateAdministrativeState body); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param body Request payload. + * @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 updateBfdForStaticRouteAdministrativeState(UpdateAdministrativeState body, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatch.java new file mode 100644 index 000000000000..a285d1a87d91 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatch.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkPatchProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The InternalNetwork patch resource definition. */ +@Fluent +public final class InternalNetworkPatch { + /* + * InternalNetwork Patch properties. + */ + @JsonProperty(value = "properties") + private InternalNetworkPatchProperties innerProperties; + + /** Creates an instance of InternalNetworkPatch class. */ + public InternalNetworkPatch() { + } + + /** + * Get the innerProperties property: InternalNetwork Patch properties. + * + * @return the innerProperties value. + */ + private InternalNetworkPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.innerProperties() == null ? null : this.innerProperties().mtu(); + } + + /** + * Set the mtu property: Maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withMtu(Integer mtu) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withMtu(mtu); + return this; + } + + /** + * Get the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv4Subnets(); + } + + /** + * Set the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @param connectedIPv4Subnets the connectedIPv4Subnets value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withConnectedIPv4Subnets(connectedIPv4Subnets); + return this; + } + + /** + * Get the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv6Subnets(); + } + + /** + * Set the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @param connectedIPv6Subnets the connectedIPv6Subnets value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withConnectedIPv6Subnets(connectedIPv6Subnets); + return this; + } + + /** + * Get the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().staticRouteConfiguration(); + } + + /** + * Set the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().bgpConfiguration(); + } + + /** + * Set the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration the bgpConfiguration value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withBgpConfiguration(bgpConfiguration); + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().importRoutePolicyId(); + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withImportRoutePolicyId(String importRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withImportRoutePolicyId(importRoutePolicyId); + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.innerProperties() == null ? null : this.innerProperties().exportRoutePolicyId(); + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withExportRoutePolicyId(String exportRoutePolicyId) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withExportRoutePolicyId(exportRoutePolicyId); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new InternalNetworkPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchableProperties.java new file mode 100644 index 000000000000..21e07357da6e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchableProperties.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ExternalNetwork patchable properties. */ +@Fluent +public class InternalNetworkPatchableProperties { + /* + * Maximum transmission unit. Default value is 1500. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * List with object connectedIPv4Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connectedIPv6Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * staticRouteConfiguration model. + */ + @JsonProperty(value = "staticRouteConfiguration") + private InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * ARM resource ID of importRoutePolicy. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /** Creates an instance of InternalNetworkPatchableProperties class. */ + public InternalNetworkPatchableProperties() { + } + + /** + * Get the mtu property: Maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: Maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connectedIPv4Subnets. + * + * @param connectedIPv4Subnets the connectedIPv4Subnets value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withConnectedIPv4Subnets( + List connectedIPv4Subnets) { + this.connectedIPv4Subnets = connectedIPv4Subnets; + return this; + } + + /** + * Get the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connectedIPv6Subnets. + * + * @param connectedIPv6Subnets the connectedIPv6Subnets value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withConnectedIPv6Subnets( + List connectedIPv6Subnets) { + this.connectedIPv6Subnets = connectedIPv6Subnets; + return this; + } + + /** + * Get the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @return the staticRouteConfiguration value. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: staticRouteConfiguration model. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withStaticRouteConfiguration( + InternalNetworkPatchablePropertiesStaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration() { + return this.bgpConfiguration; + } + + /** + * Set the bgpConfiguration property: BGP configuration properties. + * + * @param bgpConfiguration the bgpConfiguration value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withBgpConfiguration( + InternalNetworkPatchablePropertiesBgpConfiguration bgpConfiguration) { + this.bgpConfiguration = bgpConfiguration; + return this; + } + + /** + * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: ARM resource ID of importRoutePolicy. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectedIPv4Subnets() != null) { + connectedIPv4Subnets().forEach(e -> e.validate()); + } + if (connectedIPv6Subnets() != null) { + connectedIPv6Subnets().forEach(e -> e.validate()); + } + if (staticRouteConfiguration() != null) { + staticRouteConfiguration().validate(); + } + if (bgpConfiguration() != null) { + bgpConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfiguration.java new file mode 100644 index 000000000000..b4035098ab53 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfiguration.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BGP configuration properties. */ +@Fluent +public final class InternalNetworkPatchablePropertiesBgpConfiguration extends AnnotationResource { + /* + * BFD configuration properties + */ + @JsonProperty(value = "bfdConfiguration") + private BfdConfiguration bfdConfiguration; + + /* + * Originate a defaultRoute. Ex: "True" | "False". + */ + @JsonProperty(value = "defaultRouteOriginate") + private BooleanEnumProperty defaultRouteOriginate; + + /* + * Allows for routes to be received and processed even if the router detects its own ASN in the AS-Path. 0 is + * disable, Possible values are 1-10, default is 2. + */ + @JsonProperty(value = "allowAS") + private Integer allowAS; + + /* + * Enable Or Disable state. + */ + @JsonProperty(value = "allowASOverride") + private AllowASOverride allowASOverride; + + /* + * ASN of Network Fabric. Example: 65048. + */ + @JsonProperty(value = "fabricASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer fabricAsn; + + /* + * Peer ASN. Example: 65047. + */ + @JsonProperty(value = "peerASN", required = true) + private int peerAsn; + + /* + * BGP Ipv4 ListenRange. + */ + @JsonProperty(value = "ipv4ListenRangePrefixes") + private List ipv4ListenRangePrefixes; + + /* + * BGP Ipv6 ListenRange. + */ + @JsonProperty(value = "ipv6ListenRangePrefixes") + private List ipv6ListenRangePrefixes; + + /* + * List with stringified ipv4NeighborAddresses. + */ + @JsonProperty(value = "ipv4NeighborAddress") + private List ipv4NeighborAddress; + + /* + * List with stringified ipv6NeighborAddress. + */ + @JsonProperty(value = "ipv6NeighborAddress") + private List ipv6NeighborAddress; + + /** Creates an instance of InternalNetworkPatchablePropertiesBgpConfiguration class. */ + public InternalNetworkPatchablePropertiesBgpConfiguration() { + } + + /** + * Get the bfdConfiguration property: BFD configuration properties. + * + * @return the bfdConfiguration value. + */ + public BfdConfiguration bfdConfiguration() { + return this.bfdConfiguration; + } + + /** + * Set the bfdConfiguration property: BFD configuration properties. + * + * @param bfdConfiguration the bfdConfiguration value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withBfdConfiguration(BfdConfiguration bfdConfiguration) { + this.bfdConfiguration = bfdConfiguration; + return this; + } + + /** + * Get the defaultRouteOriginate property: Originate a defaultRoute. Ex: "True" | "False". + * + * @return the defaultRouteOriginate value. + */ + public BooleanEnumProperty defaultRouteOriginate() { + return this.defaultRouteOriginate; + } + + /** + * Set the defaultRouteOriginate property: Originate a defaultRoute. Ex: "True" | "False". + * + * @param defaultRouteOriginate the defaultRouteOriginate value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withDefaultRouteOriginate( + BooleanEnumProperty defaultRouteOriginate) { + this.defaultRouteOriginate = defaultRouteOriginate; + return this; + } + + /** + * Get the allowAS property: Allows for routes to be received and processed even if the router detects its own ASN + * in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + * + * @return the allowAS value. + */ + public Integer allowAS() { + return this.allowAS; + } + + /** + * Set the allowAS property: Allows for routes to be received and processed even if the router detects its own ASN + * in the AS-Path. 0 is disable, Possible values are 1-10, default is 2. + * + * @param allowAS the allowAS value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withAllowAS(Integer allowAS) { + this.allowAS = allowAS; + return this; + } + + /** + * Get the allowASOverride property: Enable Or Disable state. + * + * @return the allowASOverride value. + */ + public AllowASOverride allowASOverride() { + return this.allowASOverride; + } + + /** + * Set the allowASOverride property: Enable Or Disable state. + * + * @param allowASOverride the allowASOverride value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withAllowASOverride(AllowASOverride allowASOverride) { + this.allowASOverride = allowASOverride; + return this; + } + + /** + * Get the fabricAsn property: ASN of Network Fabric. Example: 65048. + * + * @return the fabricAsn value. + */ + public Integer fabricAsn() { + return this.fabricAsn; + } + + /** + * Get the peerAsn property: Peer ASN. Example: 65047. + * + * @return the peerAsn value. + */ + public int peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: Peer ASN. Example: 65047. + * + * @param peerAsn the peerAsn value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withPeerAsn(int peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the ipv4ListenRangePrefixes property: BGP Ipv4 ListenRange. + * + * @return the ipv4ListenRangePrefixes value. + */ + public List ipv4ListenRangePrefixes() { + return this.ipv4ListenRangePrefixes; + } + + /** + * Set the ipv4ListenRangePrefixes property: BGP Ipv4 ListenRange. + * + * @param ipv4ListenRangePrefixes the ipv4ListenRangePrefixes value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withIpv4ListenRangePrefixes( + List ipv4ListenRangePrefixes) { + this.ipv4ListenRangePrefixes = ipv4ListenRangePrefixes; + return this; + } + + /** + * Get the ipv6ListenRangePrefixes property: BGP Ipv6 ListenRange. + * + * @return the ipv6ListenRangePrefixes value. + */ + public List ipv6ListenRangePrefixes() { + return this.ipv6ListenRangePrefixes; + } + + /** + * Set the ipv6ListenRangePrefixes property: BGP Ipv6 ListenRange. + * + * @param ipv6ListenRangePrefixes the ipv6ListenRangePrefixes value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withIpv6ListenRangePrefixes( + List ipv6ListenRangePrefixes) { + this.ipv6ListenRangePrefixes = ipv6ListenRangePrefixes; + return this; + } + + /** + * Get the ipv4NeighborAddress property: List with stringified ipv4NeighborAddresses. + * + * @return the ipv4NeighborAddress value. + */ + public List ipv4NeighborAddress() { + return this.ipv4NeighborAddress; + } + + /** + * Set the ipv4NeighborAddress property: List with stringified ipv4NeighborAddresses. + * + * @param ipv4NeighborAddress the ipv4NeighborAddress value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withIpv4NeighborAddress( + List ipv4NeighborAddress) { + this.ipv4NeighborAddress = ipv4NeighborAddress; + return this; + } + + /** + * Get the ipv6NeighborAddress property: List with stringified ipv6NeighborAddress. + * + * @return the ipv6NeighborAddress value. + */ + public List ipv6NeighborAddress() { + return this.ipv6NeighborAddress; + } + + /** + * Set the ipv6NeighborAddress property: List with stringified ipv6NeighborAddress. + * + * @param ipv6NeighborAddress the ipv6NeighborAddress value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfiguration withIpv6NeighborAddress( + List ipv6NeighborAddress) { + this.ipv6NeighborAddress = ipv6NeighborAddress; + return this; + } + + /** {@inheritDoc} */ + @Override + public InternalNetworkPatchablePropertiesBgpConfiguration withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (bfdConfiguration() != null) { + bfdConfiguration().validate(); + } + if (ipv4NeighborAddress() != null) { + ipv4NeighborAddress().forEach(e -> e.validate()); + } + if (ipv6NeighborAddress() != null) { + ipv6NeighborAddress().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem.java new file mode 100644 index 000000000000..b440808f4b5d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ipv4NeighborAddress model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem { + /* + * IP Address of the IPv4NeighborAddress. + */ + @JsonProperty(value = "address") + private String address; + + /* + * operationalState of the IPv4NeighborAddress. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private String operationalState; + + /** Creates an instance of InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem class. */ + public InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem() { + } + + /** + * Get the address property: IP Address of the IPv4NeighborAddress. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: IP Address of the IPv4NeighborAddress. + * + * @param address the address value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the operationalState property: operationalState of the IPv4NeighborAddress. + * + * @return the operationalState value. + */ + public String operationalState() { + return this.operationalState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem.java new file mode 100644 index 000000000000..be3144bd9119 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ipv6NeighborAddress model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem { + /* + * ip address of the ipv6NeighborAddress. + */ + @JsonProperty(value = "address") + private String address; + + /* + * operationalState of the ipv6NeighborAddress. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private String operationalState; + + /** Creates an instance of InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem class. */ + public InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem() { + } + + /** + * Get the address property: ip address of the ipv6NeighborAddress. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: ip address of the ipv6NeighborAddress. + * + * @param address the address value to set. + * @return the InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem object itself. + */ + public InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the operationalState property: operationalState of the ipv6NeighborAddress. + * + * @return the operationalState value. + */ + public String operationalState() { + return this.operationalState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem.java new file mode 100644 index 000000000000..960080499a31 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** connectedIPv4Subnet model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem extends AnnotationResource { + /* + * Ipv4 Prefix of the connectedIPv4Subnet. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem class. */ + public InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem() { + } + + /** + * Get the prefix property: Ipv4 Prefix of the connectedIPv4Subnet. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Ipv4 Prefix of the connectedIPv4Subnet. + * + * @param prefix the prefix value to set. + * @return the InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem object itself. + */ + public InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** {@inheritDoc} */ + @Override + public InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem.java new file mode 100644 index 000000000000..085f5dc948c5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** connectedIPv6Subnet model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem extends AnnotationResource { + /* + * Ipv6 Prefix of the connectedIPv6Subnet. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem class. */ + public InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem() { + } + + /** + * Get the prefix property: Ipv6 Prefix of the connectedIPv6Subnet. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Ipv6 Prefix of the connectedIPv6Subnet. + * + * @param prefix the prefix value to set. + * @return the InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem object itself. + */ + public InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** {@inheritDoc} */ + @Override + public InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfiguration.java new file mode 100644 index 000000000000..d8db7d0b9444 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** staticRouteConfiguration model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesStaticRouteConfiguration { + /* + * BFD configuration properties + */ + @JsonProperty(value = "bfdConfiguration") + private BfdConfiguration bfdConfiguration; + + /* + * List with object IPv4Routes. + */ + @JsonProperty(value = "ipv4Routes") + private List ipv4Routes; + + /* + * List with object IPv6Routes. + */ + @JsonProperty(value = "ipv6Routes") + private List ipv6Routes; + + /** Creates an instance of InternalNetworkPatchablePropertiesStaticRouteConfiguration class. */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration() { + } + + /** + * Get the bfdConfiguration property: BFD configuration properties. + * + * @return the bfdConfiguration value. + */ + public BfdConfiguration bfdConfiguration() { + return this.bfdConfiguration; + } + + /** + * Set the bfdConfiguration property: BFD configuration properties. + * + * @param bfdConfiguration the bfdConfiguration value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration withBfdConfiguration( + BfdConfiguration bfdConfiguration) { + this.bfdConfiguration = bfdConfiguration; + return this; + } + + /** + * Get the ipv4Routes property: List with object IPv4Routes. + * + * @return the ipv4Routes value. + */ + public List ipv4Routes() { + return this.ipv4Routes; + } + + /** + * Set the ipv4Routes property: List with object IPv4Routes. + * + * @param ipv4Routes the ipv4Routes value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration withIpv4Routes( + List ipv4Routes) { + this.ipv4Routes = ipv4Routes; + return this; + } + + /** + * Get the ipv6Routes property: List with object IPv6Routes. + * + * @return the ipv6Routes value. + */ + public List ipv6Routes() { + return this.ipv6Routes; + } + + /** + * Set the ipv6Routes property: List with object IPv6Routes. + * + * @param ipv6Routes the ipv6Routes value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfiguration object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfiguration withIpv6Routes( + List ipv6Routes) { + this.ipv6Routes = ipv6Routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bfdConfiguration() != null) { + bfdConfiguration().validate(); + } + if (ipv4Routes() != null) { + ipv4Routes().forEach(e -> e.validate()); + } + if (ipv6Routes() != null) { + ipv6Routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem.java new file mode 100644 index 000000000000..df85a07984ab --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** staticIpv4Route model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem { + /* + * IPv4 prefix of the staticIpv4Route. + */ + @JsonProperty(value = "prefix", required = true) + private String prefix; + + /* + * List of next hop IPv4 addresses. + */ + @JsonProperty(value = "nextHop", required = true) + private List nextHop; + + /** Creates an instance of InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem class. */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem() { + } + + /** + * Get the prefix property: IPv4 prefix of the staticIpv4Route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: IPv4 prefix of the staticIpv4Route. + * + * @param prefix the prefix value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the nextHop property: List of next hop IPv4 addresses. + * + * @return the nextHop value. + */ + public List nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: List of next hop IPv4 addresses. + * + * @param nextHop the nextHop value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem withNextHop(List nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prefix() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property prefix in model" + + " InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem")); + } + if (nextHop() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextHop in model" + + " InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem.java new file mode 100644 index 000000000000..538f64b53f64 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** staticIPv6Route model. */ +@Fluent +public final class InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem { + /* + * IPv6 prefix of the staticIPv6Route. + */ + @JsonProperty(value = "prefix", required = true) + private String prefix; + + /* + * List of next hop IPv6 addresses. + */ + @JsonProperty(value = "nextHop", required = true) + private List nextHop; + + /** Creates an instance of InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem class. */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem() { + } + + /** + * Get the prefix property: IPv6 prefix of the staticIPv6Route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: IPv6 prefix of the staticIPv6Route. + * + * @param prefix the prefix value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the nextHop property: List of next hop IPv6 addresses. + * + * @return the nextHop value. + */ + public List nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: List of next hop IPv6 addresses. + * + * @param nextHop the nextHop value to set. + * @return the InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem object itself. + */ + public InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem withNextHop(List nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prefix() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property prefix in model" + + " InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem")); + } + if (nextHop() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nextHop in model" + + " InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworks.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworks.java new file mode 100644 index 000000000000..448f78124bd3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworks.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 InternalNetworks. */ +public interface InternalNetworks { + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @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 InternalNetworks along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String l3IsolationDomainName, String internalNetworkName, Context context); + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 InternalNetworks. + */ + InternalNetwork get(String resourceGroupName, String l3IsolationDomainName, String internalNetworkName); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName, String internalNetworkName); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @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 l3IsolationDomainName, String internalNetworkName, Context context); + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 InternalNetworks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String l3IsolationDomainName); + + /** + * Executes list operation to display list of all internal networks + * + *

Displays InternalNetworks list by resource group GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @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 list of InternalNetworks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources. + * + *

Update Administrative state of InternalNetworks on resources referred by their resource ids. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes the operation to the underlying resources for updating BGP state on edge devices. + * + *

Update BGP state for internalNetwork. Allowed only on edge devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Update BfdForBgp for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBfdForBgpAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

clearIpv6Neighbors for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 clearIpv6Neighbors( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body); + + /** + * Executes clearArpEntries operation to the underlying resources. + * + *

clearArpEntries for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 clearArpEntries( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + EnableDisableOnResources body, + Context context); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body); + + /** + * Executes update BfdForStaticRoutes operation to the underlying resources. + * + *

Update BfdForStaticRoutes for internalNetwork. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param internalNetworkName Name of the InternalNetwork. + * @param body Request payload. + * @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 updateBfdForStaticRouteAdministrativeState( + String resourceGroupName, + String l3IsolationDomainName, + String internalNetworkName, + UpdateAdministrativeState body, + Context context); + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a InternalNetworks along with {@link Response}. + */ + InternalNetwork getById(String id); + + /** + * Retrieves details of InternalNetworks using GET method. + * + *

Gets a InternalNetworks. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a InternalNetworks along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a InternalNetworks. + * + *

Implements InternalNetworks DELETE method. + * + * @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 InternalNetwork resource. + * + * @param name resource name. + * @return the first stage of the new InternalNetwork definition. + */ + InternalNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworksList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworksList.java new file mode 100644 index 000000000000..e241965f5d64 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworksList.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.InternalNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of InternalNetworks. */ +@Fluent +public final class InternalNetworksList { + /* + * List of InternalNetworks resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of InternalNetworksList class. */ + public InternalNetworksList() { + } + + /** + * Get the value property: List of InternalNetworks resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of InternalNetworks resources. + * + * @param value the value value to set. + * @return the InternalNetworksList object itself. + */ + public InternalNetworksList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the InternalNetworksList object itself. + */ + public InternalNetworksList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternetBoolean.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternetBoolean.java new file mode 100644 index 000000000000..b7ea767e2d78 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternetBoolean.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Internet access. Example: true | false. */ +public final class InternetBoolean extends ExpandableStringEnum { + /** Static value true for InternetBoolean. */ + public static final InternetBoolean TRUE = fromString("true"); + + /** Static value false for InternetBoolean. */ + public static final InternetBoolean FALSE = fromString("false"); + + /** + * Creates a new instance of InternetBoolean value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InternetBoolean() { + } + + /** + * Creates or finds a InternetBoolean from its string representation. + * + * @param name a name to look for. + * @return the corresponding InternetBoolean. + */ + @JsonCreator + public static InternetBoolean fromString(String name) { + return fromString(name, InternetBoolean.class); + } + + /** + * Gets known InternetBoolean values. + * + * @return known InternetBoolean values. + */ + public static Collection values() { + return values(InternetBoolean.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityList.java new file mode 100644 index 000000000000..8dda24cd9d6e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityList.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpCommunityList. */ +public interface IpCommunityList { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the action property: action. Example: allow | deny. + * + * @return the action value. + */ + CommunityActionType action(); + + /** + * Gets the localAS property: Local Autonomous System. Example: true | false. + * + * @return the localAS value. + */ + LocalASBoolean localAS(); + + /** + * Gets the gshut property: Graceful Shutdown (GSHUT). Example: true | false. + * + * @return the gshut value. + */ + GshutBoolean gshut(); + + /** + * Gets the internet property: Internet access. Example: true | false. + * + * @return the internet value. + */ + InternetBoolean internet(); + + /** + * Gets the advertise property: noAdvertise. Example: true | false. + * + * @return the advertise value. + */ + AdvertiseBoolean advertise(); + + /** + * Gets the export property: noExport. Example: true | false. + * + * @return the export value. + */ + ExportBoolean export(); + + /** + * Gets the communityMembers property: Ip Community List communityMembers. + * + * @return the communityMembers value. + */ + List communityMembers(); + + /** + * Gets the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @return the evpnEsImportRouteTargets value. + */ + List evpnEsImportRouteTargets(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner object. + * + * @return the inner object. + */ + IpCommunityListInner innerModel(); + + /** The entirety of the IpCommunityList definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpCommunityList definition stages. */ + interface DefinitionStages { + /** The first stage of the IpCommunityList definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpCommunityList 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 IpCommunityList 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the IpCommunityList 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.WithAction, + DefinitionStages.WithLocalAS, + DefinitionStages.WithGshut, + DefinitionStages.WithInternet, + DefinitionStages.WithAdvertise, + DefinitionStages.WithExport, + DefinitionStages.WithCommunityMembers, + DefinitionStages.WithEvpnEsImportRouteTargets, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpCommunityList create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpCommunityList create(Context context); + } + /** The stage of the IpCommunityList 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 IpCommunityList definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: action. Example: allow | deny.. + * + * @param action action. Example: allow | deny. + * @return the next definition stage. + */ + WithCreate withAction(CommunityActionType action); + } + /** The stage of the IpCommunityList definition allowing to specify localAS. */ + interface WithLocalAS { + /** + * Specifies the localAS property: Local Autonomous System. Example: true | false.. + * + * @param localAS Local Autonomous System. Example: true | false. + * @return the next definition stage. + */ + WithCreate withLocalAS(LocalASBoolean localAS); + } + /** The stage of the IpCommunityList definition allowing to specify gshut. */ + interface WithGshut { + /** + * Specifies the gshut property: Graceful Shutdown (GSHUT). Example: true | false.. + * + * @param gshut Graceful Shutdown (GSHUT). Example: true | false. + * @return the next definition stage. + */ + WithCreate withGshut(GshutBoolean gshut); + } + /** The stage of the IpCommunityList definition allowing to specify internet. */ + interface WithInternet { + /** + * Specifies the internet property: Internet access. Example: true | false.. + * + * @param internet Internet access. Example: true | false. + * @return the next definition stage. + */ + WithCreate withInternet(InternetBoolean internet); + } + /** The stage of the IpCommunityList definition allowing to specify advertise. */ + interface WithAdvertise { + /** + * Specifies the advertise property: noAdvertise. Example: true | false.. + * + * @param advertise noAdvertise. Example: true | false. + * @return the next definition stage. + */ + WithCreate withAdvertise(AdvertiseBoolean advertise); + } + /** The stage of the IpCommunityList definition allowing to specify export. */ + interface WithExport { + /** + * Specifies the export property: noExport. Example: true | false.. + * + * @param export noExport. Example: true | false. + * @return the next definition stage. + */ + WithCreate withExport(ExportBoolean export); + } + /** The stage of the IpCommunityList definition allowing to specify communityMembers. */ + interface WithCommunityMembers { + /** + * Specifies the communityMembers property: Ip Community List communityMembers.. + * + * @param communityMembers Ip Community List communityMembers. + * @return the next definition stage. + */ + WithCreate withCommunityMembers(List communityMembers); + } + /** The stage of the IpCommunityList definition allowing to specify evpnEsImportRouteTargets. */ + interface WithEvpnEsImportRouteTargets { + /** + * Specifies the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets.. + * + * @param evpnEsImportRouteTargets Ip Community List evpnEsImportRouteTargets. + * @return the next definition stage. + */ + WithCreate withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets); + } + /** The stage of the IpCommunityList definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the IpCommunityList resource. + * + * @return the stage of resource update. + */ + IpCommunityList.Update update(); + + /** The template for IpCommunityList update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAction, + UpdateStages.WithLocalAS, + UpdateStages.WithAdvertise, + UpdateStages.WithExport, + UpdateStages.WithCommunityMembers, + UpdateStages.WithEvpnEsImportRouteTargets, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpCommunityList apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpCommunityList apply(Context context); + } + /** The IpCommunityList update stages. */ + interface UpdateStages { + /** The stage of the IpCommunityList 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); + } + /** The stage of the IpCommunityList update allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: action. Example: allow | deny.. + * + * @param action action. Example: allow | deny. + * @return the next definition stage. + */ + Update withAction(CommunityActionType action); + } + /** The stage of the IpCommunityList update allowing to specify localAS. */ + interface WithLocalAS { + /** + * Specifies the localAS property: Local Autonomous System. Example: true | false.. + * + * @param localAS Local Autonomous System. Example: true | false. + * @return the next definition stage. + */ + Update withLocalAS(LocalASBoolean localAS); + } + /** The stage of the IpCommunityList update allowing to specify advertise. */ + interface WithAdvertise { + /** + * Specifies the advertise property: noAdvertise. Example: true | false.. + * + * @param advertise noAdvertise. Example: true | false. + * @return the next definition stage. + */ + Update withAdvertise(AdvertiseBoolean advertise); + } + /** The stage of the IpCommunityList update allowing to specify export. */ + interface WithExport { + /** + * Specifies the export property: noExport. Example: true | false.. + * + * @param export noExport. Example: true | false. + * @return the next definition stage. + */ + Update withExport(ExportBoolean export); + } + /** The stage of the IpCommunityList update allowing to specify communityMembers. */ + interface WithCommunityMembers { + /** + * Specifies the communityMembers property: Ip Community List communityMembers.. + * + * @param communityMembers Ip Community List communityMembers. + * @return the next definition stage. + */ + Update withCommunityMembersForUpdate( + List communityMembers); + } + /** The stage of the IpCommunityList update allowing to specify evpnEsImportRouteTargets. */ + interface WithEvpnEsImportRouteTargets { + /** + * Specifies the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets.. + * + * @param evpnEsImportRouteTargets Ip Community List evpnEsImportRouteTargets. + * @return the next definition stage. + */ + Update withEvpnEsImportRouteTargetsForUpdate( + List evpnEsImportRouteTargets); + } + /** The stage of the IpCommunityList update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpCommunityList refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpCommunityList refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatch.java new file mode 100644 index 000000000000..f5d9367f0c40 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatch.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpCommunityList patch resource definition. */ +@Fluent +public final class IpCommunityListPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private IpCommunityListPatchProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of IpCommunityListPatch class. */ + public IpCommunityListPatch() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpCommunityListPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public CommunityActionType action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withAction(CommunityActionType action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the localAS property: Local Autonomous System. Example: true | false. + * + * @return the localAS value. + */ + public LocalASBoolean localAS() { + return this.innerProperties() == null ? null : this.innerProperties().localAS(); + } + + /** + * Set the localAS property: Local Autonomous System. Example: true | false. + * + * @param localAS the localAS value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withLocalAS(LocalASBoolean localAS) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withLocalAS(localAS); + return this; + } + + /** + * Get the advertise property: noAdvertise. Example: true | false. + * + * @return the advertise value. + */ + public AdvertiseBoolean advertise() { + return this.innerProperties() == null ? null : this.innerProperties().advertise(); + } + + /** + * Set the advertise property: noAdvertise. Example: true | false. + * + * @param advertise the advertise value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withAdvertise(AdvertiseBoolean advertise) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withAdvertise(advertise); + return this; + } + + /** + * Get the export property: noExport. Example: true | false. + * + * @return the export value. + */ + public ExportBoolean export() { + return this.innerProperties() == null ? null : this.innerProperties().export(); + } + + /** + * Set the export property: noExport. Example: true | false. + * + * @param export the export value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withExport(ExportBoolean export) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withExport(export); + return this; + } + + /** + * Get the communityMembers property: Ip Community List communityMembers. + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.innerProperties() == null ? null : this.innerProperties().communityMembers(); + } + + /** + * Set the communityMembers property: Ip Community List communityMembers. + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withCommunityMembers( + List communityMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withCommunityMembers(communityMembers); + return this; + } + + /** + * Get the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @return the evpnEsImportRouteTargets value. + */ + public List evpnEsImportRouteTargets() { + return this.innerProperties() == null ? null : this.innerProperties().evpnEsImportRouteTargets(); + } + + /** + * Set the evpnEsImportRouteTargets property: Ip Community List evpnEsImportRouteTargets. + * + * @param evpnEsImportRouteTargets the evpnEsImportRouteTargets value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withEvpnEsImportRouteTargets( + List evpnEsImportRouteTargets) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withEvpnEsImportRouteTargets(evpnEsImportRouteTargets); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the IpCommunityListPatch object itself. + */ + public IpCommunityListPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityListPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesCommunityMembersItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesCommunityMembersItem.java new file mode 100644 index 000000000000..50682f3f490a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesCommunityMembersItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ip Community List communityMembers model. */ +@Fluent +public final class IpCommunityListPatchPropertiesCommunityMembersItem extends AnnotationResource { + /* + * communityMember of the Ip Community List. Example: 100:200 + */ + @JsonProperty(value = "communityMember", required = true) + private String communityMember; + + /** Creates an instance of IpCommunityListPatchPropertiesCommunityMembersItem class. */ + public IpCommunityListPatchPropertiesCommunityMembersItem() { + } + + /** + * Get the communityMember property: communityMember of the Ip Community List. Example: 100:200. + * + * @return the communityMember value. + */ + public String communityMember() { + return this.communityMember; + } + + /** + * Set the communityMember property: communityMember of the Ip Community List. Example: 100:200. + * + * @param communityMember the communityMember value to set. + * @return the IpCommunityListPatchPropertiesCommunityMembersItem object itself. + */ + public IpCommunityListPatchPropertiesCommunityMembersItem withCommunityMember(String communityMember) { + this.communityMember = communityMember; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListPatchPropertiesCommunityMembersItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (communityMember() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property communityMember in model" + + " IpCommunityListPatchPropertiesCommunityMembersItem")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(IpCommunityListPatchPropertiesCommunityMembersItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem.java new file mode 100644 index 000000000000..73447beb75fb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ip Community List evpnEsImportRouteTarget model. */ +@Fluent +public final class IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem extends AnnotationResource { + /* + * evpnEsImportRouteTarget of the Ip Community List. Example: 100:400 + */ + @JsonProperty(value = "evpnEsImportRouteTarget", required = true) + private String evpnEsImportRouteTarget; + + /** Creates an instance of IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem class. */ + public IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem() { + } + + /** + * Get the evpnEsImportRouteTarget property: evpnEsImportRouteTarget of the Ip Community List. Example: 100:400. + * + * @return the evpnEsImportRouteTarget value. + */ + public String evpnEsImportRouteTarget() { + return this.evpnEsImportRouteTarget; + } + + /** + * Set the evpnEsImportRouteTarget property: evpnEsImportRouteTarget of the Ip Community List. Example: 100:400. + * + * @param evpnEsImportRouteTarget the evpnEsImportRouteTarget value to set. + * @return the IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem object itself. + */ + public IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem withEvpnEsImportRouteTarget( + String evpnEsImportRouteTarget) { + this.evpnEsImportRouteTarget = evpnEsImportRouteTarget; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (evpnEsImportRouteTarget() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property evpnEsImportRouteTarget in model" + + " IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(IpCommunityListPatchPropertiesEvpnEsImportRouteTargetsItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesCommunityMembersItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesCommunityMembersItem.java new file mode 100644 index 000000000000..3fc46ec21483 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesCommunityMembersItem.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ip Community List communityMembers model. */ +@Fluent +public final class IpCommunityListPropertiesCommunityMembersItem extends AnnotationResource { + /* + * communityMember of the Ip Community List. Example: 100:200 + */ + @JsonProperty(value = "communityMember", required = true) + private String communityMember; + + /** Creates an instance of IpCommunityListPropertiesCommunityMembersItem class. */ + public IpCommunityListPropertiesCommunityMembersItem() { + } + + /** + * Get the communityMember property: communityMember of the Ip Community List. Example: 100:200. + * + * @return the communityMember value. + */ + public String communityMember() { + return this.communityMember; + } + + /** + * Set the communityMember property: communityMember of the Ip Community List. Example: 100:200. + * + * @param communityMember the communityMember value to set. + * @return the IpCommunityListPropertiesCommunityMembersItem object itself. + */ + public IpCommunityListPropertiesCommunityMembersItem withCommunityMember(String communityMember) { + this.communityMember = communityMember; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListPropertiesCommunityMembersItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (communityMember() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property communityMember in model" + + " IpCommunityListPropertiesCommunityMembersItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpCommunityListPropertiesCommunityMembersItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesEvpnEsImportRouteTargetsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesEvpnEsImportRouteTargetsItem.java new file mode 100644 index 000000000000..0695721c9e3d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListPropertiesEvpnEsImportRouteTargetsItem.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ip Community List evpnEsImportRouteTarget model. */ +@Fluent +public final class IpCommunityListPropertiesEvpnEsImportRouteTargetsItem extends AnnotationResource { + /* + * evpnEsImportRouteTarget of the Ip Community List. Example: 100:400 + */ + @JsonProperty(value = "evpnEsImportRouteTarget", required = true) + private String evpnEsImportRouteTarget; + + /** Creates an instance of IpCommunityListPropertiesEvpnEsImportRouteTargetsItem class. */ + public IpCommunityListPropertiesEvpnEsImportRouteTargetsItem() { + } + + /** + * Get the evpnEsImportRouteTarget property: evpnEsImportRouteTarget of the Ip Community List. Example: 100:400. + * + * @return the evpnEsImportRouteTarget value. + */ + public String evpnEsImportRouteTarget() { + return this.evpnEsImportRouteTarget; + } + + /** + * Set the evpnEsImportRouteTarget property: evpnEsImportRouteTarget of the Ip Community List. Example: 100:400. + * + * @param evpnEsImportRouteTarget the evpnEsImportRouteTarget value to set. + * @return the IpCommunityListPropertiesEvpnEsImportRouteTargetsItem object itself. + */ + public IpCommunityListPropertiesEvpnEsImportRouteTargetsItem withEvpnEsImportRouteTarget( + String evpnEsImportRouteTarget) { + this.evpnEsImportRouteTarget = evpnEsImportRouteTarget; + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityListPropertiesEvpnEsImportRouteTargetsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (evpnEsImportRouteTarget() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property evpnEsImportRouteTarget in model" + + " IpCommunityListPropertiesEvpnEsImportRouteTargetsItem")); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(IpCommunityListPropertiesEvpnEsImportRouteTargetsItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityLists.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityLists.java new file mode 100644 index 000000000000..eae1fe56b16d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityLists.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 IpCommunityLists. */ +public interface IpCommunityLists { + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @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 IpCommunityList resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context); + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition. + */ + IpCommunityList getByResourceGroup(String resourceGroupName, String ipCommunityListName); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityListName, Context context); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityListName Name of the Ip Community List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipCommunityListName); + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpCommunityLists by resource group. + * + *

Implements IpCommunityLists list by resource group GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 IpCommunityLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IpCommunityLists by subscription. + * + *

Implements IpCommunityLists list by subscription GET method. + * + * @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 list of IpCommunityLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @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 the IpCommunityList resource definition along with {@link Response}. + */ + IpCommunityList getById(String id); + + /** + * Gets a Ip Community List. + * + *

Implements Ip Community List GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunityList resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Ip Community List. + * + *

Implements Ip Community List DELETE method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IpCommunityList resource. + * + * @param name resource name. + * @return the first stage of the new IpCommunityList definition. + */ + IpCommunityList.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListsListResult.java new file mode 100644 index 000000000000..29b5a66c6daf --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityListsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityListInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IpCommunityLists. */ +@Fluent +public final class IpCommunityListsListResult { + /* + * List of IpCommunityList resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of IpCommunityListsListResult class. */ + public IpCommunityListsListResult() { + } + + /** + * Get the value property: List of IpCommunityList resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IpCommunityList resources. + * + * @param value the value value to set. + * @return the IpCommunityListsListResult object itself. + */ + public IpCommunityListsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the IpCommunityListsListResult object itself. + */ + public IpCommunityListsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixList.java new file mode 100644 index 000000000000..e7d4d1a72563 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixList.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import java.util.Map; + +/** An immutable client-side representation of IpPrefixList. */ +public interface IpPrefixList { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the action property: action. Example: allow | deny. + * + * @return the action value. + */ + PrefixActionType action(); + + /** + * Gets the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @return the sequenceNumber value. + */ + int sequenceNumber(); + + /** + * Gets the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @return the networkAddress value. + */ + String networkAddress(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner object. + * + * @return the inner object. + */ + IpPrefixListInner innerModel(); + + /** The entirety of the IpPrefixList definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithAction, + DefinitionStages.WithSequenceNumber, + DefinitionStages.WithNetworkAddress, + DefinitionStages.WithCreate { + } + /** The IpPrefixList definition stages. */ + interface DefinitionStages { + /** The first stage of the IpPrefixList definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpPrefixList 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 IpPrefixList 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. + */ + WithAction withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the IpPrefixList definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: action. Example: allow | deny.. + * + * @param action action. Example: allow | deny. + * @return the next definition stage. + */ + WithSequenceNumber withAction(PrefixActionType action); + } + /** The stage of the IpPrefixList definition allowing to specify sequenceNumber. */ + interface WithSequenceNumber { + /** + * Specifies the sequenceNumber property: sequenceNumber of the Ip Prefix List.. + * + * @param sequenceNumber sequenceNumber of the Ip Prefix List. + * @return the next definition stage. + */ + WithNetworkAddress withSequenceNumber(int sequenceNumber); + } + /** The stage of the IpPrefixList definition allowing to specify networkAddress. */ + interface WithNetworkAddress { + /** + * Specifies the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10.. + * + * @param networkAddress networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * @return the next definition stage. + */ + WithCreate withNetworkAddress(String networkAddress); + } + /** + * The stage of the IpPrefixList 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.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpPrefixList create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpPrefixList create(Context context); + } + /** The stage of the IpPrefixList 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 IpPrefixList definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the IpPrefixList resource. + * + * @return the stage of resource update. + */ + IpPrefixList.Update update(); + + /** The template for IpPrefixList update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAction, + UpdateStages.WithSequenceNumber, + UpdateStages.WithNetworkAddress, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpPrefixList apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpPrefixList apply(Context context); + } + /** The IpPrefixList update stages. */ + interface UpdateStages { + /** The stage of the IpPrefixList 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); + } + /** The stage of the IpPrefixList update allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: action. Example: allow | deny.. + * + * @param action action. Example: allow | deny. + * @return the next definition stage. + */ + Update withAction(PrefixActionType action); + } + /** The stage of the IpPrefixList update allowing to specify sequenceNumber. */ + interface WithSequenceNumber { + /** + * Specifies the sequenceNumber property: sequenceNumber of the Ip Prefix List.. + * + * @param sequenceNumber sequenceNumber of the Ip Prefix List. + * @return the next definition stage. + */ + Update withSequenceNumber(Integer sequenceNumber); + } + /** The stage of the IpPrefixList update allowing to specify networkAddress. */ + interface WithNetworkAddress { + /** + * Specifies the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10.. + * + * @param networkAddress networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * @return the next definition stage. + */ + Update withNetworkAddress(String networkAddress); + } + /** The stage of the IpPrefixList update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpPrefixList refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpPrefixList refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListPatch.java new file mode 100644 index 000000000000..9b974c183762 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListPatch.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IpPrefixList patch resource definition. */ +@Fluent +public final class IpPrefixListPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private IpPrefixListPatchProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of IpPrefixListPatch class. */ + public IpPrefixListPatch() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpPrefixListPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 IpPrefixListPatch object itself. + */ + public IpPrefixListPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the action property: action. Example: allow | deny. + * + * @return the action value. + */ + public PrefixActionType action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: action. Example: allow | deny. + * + * @param action the action value to set. + * @return the IpPrefixListPatch object itself. + */ + public IpPrefixListPatch withAction(PrefixActionType action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListPatchProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @return the sequenceNumber value. + */ + public Integer sequenceNumber() { + return this.innerProperties() == null ? null : this.innerProperties().sequenceNumber(); + } + + /** + * Set the sequenceNumber property: sequenceNumber of the Ip Prefix List. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the IpPrefixListPatch object itself. + */ + public IpPrefixListPatch withSequenceNumber(Integer sequenceNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListPatchProperties(); + } + this.innerProperties().withSequenceNumber(sequenceNumber); + return this; + } + + /** + * Get the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @return the networkAddress value. + */ + public String networkAddress() { + return this.innerProperties() == null ? null : this.innerProperties().networkAddress(); + } + + /** + * Set the networkAddress property: networkAddress. Example:1.1.1.0/24 | 1.1.10.10. + * + * @param networkAddress the networkAddress value to set. + * @return the IpPrefixListPatch object itself. + */ + public IpPrefixListPatch withNetworkAddress(String networkAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListPatchProperties(); + } + this.innerProperties().withNetworkAddress(networkAddress); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the IpPrefixListPatch object itself. + */ + public IpPrefixListPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixListPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixLists.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixLists.java new file mode 100644 index 000000000000..f967be9b1df4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixLists.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 IpPrefixLists. */ +public interface IpPrefixLists { + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @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 IpPrefixList resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context); + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition. + */ + IpPrefixList getByResourceGroup(String resourceGroupName, String ipPrefixListName); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixListName, Context context); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixListName Name of the Ip Prefix List. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipPrefixListName); + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpPrefixLists by resource group. + * + *

Implements IpPrefixLists list by resource group GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 IpPrefixLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IpPrefixLists by subscription. + * + *

Implements IpPrefixLists list by subscription GET method. + * + * @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 list of IpPrefixLists as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @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 the IpPrefixList resource definition along with {@link Response}. + */ + IpPrefixList getById(String id); + + /** + * Gets a Ip Prefix List. + * + *

Implements Ip Prefix List GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpPrefixList resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Ip Prefix List. + * + *

Implements Ip Prefix List DELETE method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IpPrefixList resource. + * + * @param name resource name. + * @return the first stage of the new IpPrefixList definition. + */ + IpPrefixList.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListsListResult.java new file mode 100644 index 000000000000..0de85af6b048 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixListsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixListInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IpPrefixLists. */ +@Fluent +public final class IpPrefixListsListResult { + /* + * List of IpPrefixList resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of IpPrefixListsListResult class. */ + public IpPrefixListsListResult() { + } + + /** + * Get the value property: List of IpPrefixList resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IpPrefixList resources. + * + * @param value the value value to set. + * @return the IpPrefixListsListResult object itself. + */ + public IpPrefixListsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the IpPrefixListsListResult object itself. + */ + public IpPrefixListsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsCurrentVersion.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsCurrentVersion.java new file mode 100644 index 000000000000..091b354a5d6c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsCurrentVersion.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** If the current version is in use. */ +public final class IsCurrentVersion extends ExpandableStringEnum { + /** Static value true for IsCurrentVersion. */ + public static final IsCurrentVersion TRUE = fromString("true"); + + /** Static value false for IsCurrentVersion. */ + public static final IsCurrentVersion FALSE = fromString("false"); + + /** + * Creates a new instance of IsCurrentVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsCurrentVersion() { + } + + /** + * Creates or finds a IsCurrentVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsCurrentVersion. + */ + @JsonCreator + public static IsCurrentVersion fromString(String name) { + return fromString(name, IsCurrentVersion.class); + } + + /** + * Gets known IsCurrentVersion values. + * + * @return known IsCurrentVersion values. + */ + public static Collection values() { + return values(IsCurrentVersion.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsTestVersion.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsTestVersion.java new file mode 100644 index 000000000000..d6f3b6865f35 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsTestVersion.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** If the current version is a test version. */ +public final class IsTestVersion extends ExpandableStringEnum { + /** Static value true for IsTestVersion. */ + public static final IsTestVersion TRUE = fromString("true"); + + /** Static value false for IsTestVersion. */ + public static final IsTestVersion FALSE = fromString("false"); + + /** + * Creates a new instance of IsTestVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsTestVersion() { + } + + /** + * Creates or finds a IsTestVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsTestVersion. + */ + @JsonCreator + public static IsTestVersion fromString(String name) { + return fromString(name, IsTestVersion.class); + } + + /** + * Gets known IsTestVersion values. + * + * @return known IsTestVersion values. + */ + public static Collection values() { + return values(IsTestVersion.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomain.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomain.java new file mode 100644 index 000000000000..542cba752b94 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomain.java @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of L2IsolationDomain. */ +public interface L2IsolationDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + String networkFabricId(); + + /** + * Gets the vlanId property: vlanId. Example: 501. + * + * @return the vlanId value. + */ + int vlanId(); + + /** + * Gets the mtu property: maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + Integer mtu(); + + /** + * Gets the disabledOnResources property: List of resources the L2 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + List disabledOnResources(); + + /** + * Gets the administrativeState property: state. Example: Enabled | Disabled. It indicates administrative state of + * the isolationDomain, whether it is enabled or disabled. If enabled, the configuration is applied on the devices. + * If disabled, the configuration is removed from the devices. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner object. + * + * @return the inner object. + */ + L2IsolationDomainInner innerModel(); + + /** The entirety of the L2IsolationDomain definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The L2IsolationDomain definition stages. */ + interface DefinitionStages { + /** The first stage of the L2IsolationDomain definition. */ + interface Blank extends WithLocation { + } + /** The stage of the L2IsolationDomain 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 L2IsolationDomain 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the L2IsolationDomain 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.WithNetworkFabricId, + DefinitionStages.WithVlanId, + DefinitionStages.WithMtu, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + L2IsolationDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + L2IsolationDomain create(Context context); + } + /** The stage of the L2IsolationDomain 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 L2IsolationDomain definition allowing to specify networkFabricId. */ + interface WithNetworkFabricId { + /** + * Specifies the networkFabricId property: Network Fabric ARM resource id.. + * + * @param networkFabricId Network Fabric ARM resource id. + * @return the next definition stage. + */ + WithCreate withNetworkFabricId(String networkFabricId); + } + /** The stage of the L2IsolationDomain definition allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: vlanId. Example: 501.. + * + * @param vlanId vlanId. Example: 501. + * @return the next definition stage. + */ + WithCreate withVlanId(int vlanId); + } + /** The stage of the L2IsolationDomain definition allowing to specify mtu. */ + interface WithMtu { + /** + * Specifies the mtu property: maximum transmission unit. Default value is 1500.. + * + * @param mtu maximum transmission unit. Default value is 1500. + * @return the next definition stage. + */ + WithCreate withMtu(Integer mtu); + } + /** The stage of the L2IsolationDomain definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the L2IsolationDomain resource. + * + * @return the stage of resource update. + */ + L2IsolationDomain.Update update(); + + /** The template for L2IsolationDomain update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithMtu, UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + L2IsolationDomain apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + L2IsolationDomain apply(Context context); + } + /** The L2IsolationDomain update stages. */ + interface UpdateStages { + /** The stage of the L2IsolationDomain 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); + } + /** The stage of the L2IsolationDomain update allowing to specify mtu. */ + interface WithMtu { + /** + * Specifies the mtu property: maximum transmission unit. Default value is 1500.. + * + * @param mtu maximum transmission unit. Default value is 1500. + * @return the next definition stage. + */ + Update withMtu(Integer mtu); + } + /** The stage of the L2IsolationDomain update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + L2IsolationDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + L2IsolationDomain refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState(UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param body Request payload. + * @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 updateAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param body Request payload. + * @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 clearArpTable(EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param body Request payload. + * @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 clearNeighborTable(EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device. + */ + Map getArpEntries(); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @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 show ARP entries response per network device. + */ + Map getArpEntries(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainPatch.java new file mode 100644 index 000000000000..64bfaa34b064 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainPatch.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The L2IsolationDomain patch resource definition. */ +@Fluent +public final class L2IsolationDomainPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private L2IsolationDomainPatchProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of L2IsolationDomainPatch class. */ + public L2IsolationDomainPatch() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private L2IsolationDomainPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 L2IsolationDomainPatch object itself. + */ + public L2IsolationDomainPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the mtu property: maximum transmission unit. Default value is 1500. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.innerProperties() == null ? null : this.innerProperties().mtu(); + } + + /** + * Set the mtu property: maximum transmission unit. Default value is 1500. + * + * @param mtu the mtu value to set. + * @return the L2IsolationDomainPatch object itself. + */ + public L2IsolationDomainPatch withMtu(Integer mtu) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainPatchProperties(); + } + this.innerProperties().withMtu(mtu); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the L2IsolationDomainPatch object itself. + */ + public L2IsolationDomainPatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new L2IsolationDomainPatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomains.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomains.java new file mode 100644 index 000000000000..8cfcf9bdab27 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomains.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.managednetworkfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.Map; + +/** Resource collection API of L2IsolationDomains. */ +public interface L2IsolationDomains { + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @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 L2IsolationDomain resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String l2IsolationDomainName, Context context); + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition. + */ + L2IsolationDomain getByResourceGroup(String resourceGroupName, String l2IsolationDomainName); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l2IsolationDomainName); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2 Isolation Domain. + * @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 l2IsolationDomainName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body); + + /** + * Implements the operation to the underlying resources. + * + *

Enables isolation domain across the fabric or on specified racks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, String l2IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 clearArpTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @param body Request payload. + * @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 clearNeighborTable( + String resourceGroupName, String l2IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return show ARP entries response per network device. + */ + Map getArpEntries(String resourceGroupName, String l2IsolationDomainName); + + /** + * Implements the operation to the underlying resources. + * + *

Clears IPv6 neighbors for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2IsolationDomainName Name of the L2IsolationDomain. + * @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 show ARP entries response per network device. + */ + Map getArpEntries(String resourceGroupName, String l2IsolationDomainName, Context context); + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List L2IsolationDomains by resource group. + * + *

Displays L2IsolationDomains list by resource group GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List L2IsolationDomains by subscription. + * + *

Displays L2IsolationDomains list by subscription GET method. + * + * @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 list of L2IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @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 the L2IsolationDomain resource definition along with {@link Response}. + */ + L2IsolationDomain getById(String id); + + /** + * Retrieves details of this L2 Isolation Domain. + * + *

Implements L2 Isolation Domain GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L2IsolationDomain resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @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 named L2 Isolation Domain + * + *

Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. + * + * @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 L2IsolationDomain resource. + * + * @param name resource name. + * @return the first stage of the new L2IsolationDomain definition. + */ + L2IsolationDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainsListResult.java new file mode 100644 index 000000000000..f866fa62597a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L2IsolationDomainInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of L2IsolationDomains. */ +@Fluent +public final class L2IsolationDomainsListResult { + /* + * Displays list of L2IsolationDomain resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of L2IsolationDomainsListResult class. */ + public L2IsolationDomainsListResult() { + } + + /** + * Get the value property: Displays list of L2IsolationDomain resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Displays list of L2IsolationDomain resources. + * + * @param value the value value to set. + * @return the L2IsolationDomainsListResult object itself. + */ + public L2IsolationDomainsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the L2IsolationDomainsListResult object itself. + */ + public L2IsolationDomainsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomain.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomain.java new file mode 100644 index 000000000000..b787ddfefd26 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomain.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of L3IsolationDomain. */ +public interface L3IsolationDomain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + String networkFabricId(); + + /** + * Gets the disabledOnResources property: List of resources the L3 Isolation Domain is disabled on. Can be either + * entire NetworkFabric or NetworkRack. + * + * @return the disabledOnResources value. + */ + List disabledOnResources(); + + /** + * Gets the administrativeState property: Administrative state of the IsolationDomain. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the optionBDisabledOnResources property: List of resources the OptionB is disabled on. Can be either entire + * NetworkFabric or NetworkRack. + * + * @return the optionBDisabledOnResources value. + */ + List optionBDisabledOnResources(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @return the redistributeConnectedSubnets value. + */ + RedistributeConnectedSubnets redistributeConnectedSubnets(); + + /** + * Gets the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @return the redistributeStaticRoutes value. + */ + RedistributeStaticRoutes redistributeStaticRoutes(); + + /** + * Gets the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @return the aggregateRouteConfiguration value. + */ + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration(); + + /** + * Gets the description property: L3 Isolation Domain description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @return the connectedSubnetRoutePolicy value. + */ + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner object. + * + * @return the inner object. + */ + L3IsolationDomainInner innerModel(); + + /** The entirety of the L3IsolationDomain definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The L3IsolationDomain definition stages. */ + interface DefinitionStages { + /** The first stage of the L3IsolationDomain definition. */ + interface Blank extends WithLocation { + } + /** The stage of the L3IsolationDomain 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 L3IsolationDomain 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the L3IsolationDomain 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.WithNetworkFabricId, + DefinitionStages.WithRedistributeConnectedSubnets, + DefinitionStages.WithRedistributeStaticRoutes, + DefinitionStages.WithAggregateRouteConfiguration, + DefinitionStages.WithDescription, + DefinitionStages.WithConnectedSubnetRoutePolicy, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + L3IsolationDomain create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + L3IsolationDomain create(Context context); + } + /** The stage of the L3IsolationDomain 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 L3IsolationDomain definition allowing to specify networkFabricId. */ + interface WithNetworkFabricId { + /** + * Specifies the networkFabricId property: Network Fabric ARM resource id.. + * + * @param networkFabricId Network Fabric ARM resource id. + * @return the next definition stage. + */ + WithCreate withNetworkFabricId(String networkFabricId); + } + /** The stage of the L3IsolationDomain definition allowing to specify redistributeConnectedSubnets. */ + interface WithRedistributeConnectedSubnets { + /** + * Specifies the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False".. + * + * @param redistributeConnectedSubnets Advertise Connected Subnets. Ex: "True" | "False". + * @return the next definition stage. + */ + WithCreate withRedistributeConnectedSubnets(RedistributeConnectedSubnets redistributeConnectedSubnets); + } + /** The stage of the L3IsolationDomain definition allowing to specify redistributeStaticRoutes. */ + interface WithRedistributeStaticRoutes { + /** + * Specifies the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False".. + * + * @param redistributeStaticRoutes Advertise Static Routes. Ex: "True" | "False". + * @return the next definition stage. + */ + WithCreate withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes); + } + /** The stage of the L3IsolationDomain definition allowing to specify aggregateRouteConfiguration. */ + interface WithAggregateRouteConfiguration { + /** + * Specifies the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations.. + * + * @param aggregateRouteConfiguration List of Ipv4 and Ipv6 route configurations. + * @return the next definition stage. + */ + WithCreate withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration); + } + /** The stage of the L3IsolationDomain definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: L3 Isolation Domain description.. + * + * @param description L3 Isolation Domain description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the L3IsolationDomain definition allowing to specify connectedSubnetRoutePolicy. */ + interface WithConnectedSubnetRoutePolicy { + /** + * Specifies the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy Connected Subnet RoutePolicy. + * @return the next definition stage. + */ + WithCreate withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy); + } + /** The stage of the L3IsolationDomain definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the L3IsolationDomain resource. + * + * @return the stage of resource update. + */ + L3IsolationDomain.Update update(); + + /** The template for L3IsolationDomain update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithRedistributeConnectedSubnets, + UpdateStages.WithRedistributeStaticRoutes, + UpdateStages.WithAggregateRouteConfiguration, + UpdateStages.WithDescription, + UpdateStages.WithConnectedSubnetRoutePolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + L3IsolationDomain apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + L3IsolationDomain apply(Context context); + } + /** The L3IsolationDomain update stages. */ + interface UpdateStages { + /** The stage of the L3IsolationDomain 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); + } + /** The stage of the L3IsolationDomain update allowing to specify redistributeConnectedSubnets. */ + interface WithRedistributeConnectedSubnets { + /** + * Specifies the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False".. + * + * @param redistributeConnectedSubnets Advertise Connected Subnets. Ex: "True" | "False". + * @return the next definition stage. + */ + Update withRedistributeConnectedSubnets(RedistributeConnectedSubnets redistributeConnectedSubnets); + } + /** The stage of the L3IsolationDomain update allowing to specify redistributeStaticRoutes. */ + interface WithRedistributeStaticRoutes { + /** + * Specifies the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False".. + * + * @param redistributeStaticRoutes Advertise Static Routes. Ex: "True" | "False". + * @return the next definition stage. + */ + Update withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes); + } + /** The stage of the L3IsolationDomain update allowing to specify aggregateRouteConfiguration. */ + interface WithAggregateRouteConfiguration { + /** + * Specifies the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations.. + * + * @param aggregateRouteConfiguration List of Ipv4 and Ipv6 route configurations. + * @return the next definition stage. + */ + Update withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration); + } + /** The stage of the L3IsolationDomain update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: L3 Isolation Domain description.. + * + * @param description L3 Isolation Domain description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the L3IsolationDomain update allowing to specify connectedSubnetRoutePolicy. */ + interface WithConnectedSubnetRoutePolicy { + /** + * Specifies the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy Connected Subnet RoutePolicy. + * @return the next definition stage. + */ + Update withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + L3IsolationDomain refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + L3IsolationDomain refresh(Context context); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState(UpdateAdministrativeState body); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param body Request payload. + * @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 updateAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateOptionBAdministrativeState(UpdateAdministrativeState body); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param body Request payload. + * @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 updateOptionBAdministrativeState(UpdateAdministrativeState body, Context context); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(EnableDisableOnResources body); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param body Request payload. + * @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 clearArpTable(EnableDisableOnResources body, Context context); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(EnableDisableOnResources body); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param body Request payload. + * @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 clearNeighborTable(EnableDisableOnResources body, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatch.java new file mode 100644 index 000000000000..cfa6ca098b8f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatch.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The L3IsolationDomain patch resource definition. */ +@Fluent +public final class L3IsolationDomainPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private L3IsolationDomainPatchProperties innerProperties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of L3IsolationDomainPatch class. */ + public L3IsolationDomainPatch() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private L3IsolationDomainPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @return the redistributeConnectedSubnets value. + */ + public RedistributeConnectedSubnets redistributeConnectedSubnets() { + return this.innerProperties() == null ? null : this.innerProperties().redistributeConnectedSubnets(); + } + + /** + * Set the redistributeConnectedSubnets property: Advertise Connected Subnets. Ex: "True" | "False". + * + * @param redistributeConnectedSubnets the redistributeConnectedSubnets value to set. + * @return the L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withRedistributeConnectedSubnets( + RedistributeConnectedSubnets redistributeConnectedSubnets) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainPatchProperties(); + } + this.innerProperties().withRedistributeConnectedSubnets(redistributeConnectedSubnets); + return this; + } + + /** + * Get the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @return the redistributeStaticRoutes value. + */ + public RedistributeStaticRoutes redistributeStaticRoutes() { + return this.innerProperties() == null ? null : this.innerProperties().redistributeStaticRoutes(); + } + + /** + * Set the redistributeStaticRoutes property: Advertise Static Routes. Ex: "True" | "False". + * + * @param redistributeStaticRoutes the redistributeStaticRoutes value to set. + * @return the L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withRedistributeStaticRoutes(RedistributeStaticRoutes redistributeStaticRoutes) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainPatchProperties(); + } + this.innerProperties().withRedistributeStaticRoutes(redistributeStaticRoutes); + return this; + } + + /** + * Get the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @return the aggregateRouteConfiguration value. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().aggregateRouteConfiguration(); + } + + /** + * Set the aggregateRouteConfiguration property: List of Ipv4 and Ipv6 route configurations. + * + * @param aggregateRouteConfiguration the aggregateRouteConfiguration value to set. + * @return the L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withAggregateRouteConfiguration( + L3IsolationDomainPatchPropertiesAggregateRouteConfiguration aggregateRouteConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainPatchProperties(); + } + this.innerProperties().withAggregateRouteConfiguration(aggregateRouteConfiguration); + return this; + } + + /** + * Get the description property: L3 Isolation Domain description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: L3 Isolation Domain description. + * + * @param description the description value to set. + * @return the L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainPatchProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @return the connectedSubnetRoutePolicy value. + */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().connectedSubnetRoutePolicy(); + } + + /** + * Set the connectedSubnetRoutePolicy property: Connected Subnet RoutePolicy. + * + * @param connectedSubnetRoutePolicy the connectedSubnetRoutePolicy value to set. + * @return the L3IsolationDomainPatch object itself. + */ + public L3IsolationDomainPatch withConnectedSubnetRoutePolicy( + L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy connectedSubnetRoutePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new L3IsolationDomainPatchProperties(); + } + this.innerProperties().withConnectedSubnetRoutePolicy(connectedSubnetRoutePolicy); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfiguration.java new file mode 100644 index 000000000000..1cfbba94f97f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Ipv4 and Ipv6 route configurations. */ +@Fluent +public final class L3IsolationDomainPatchPropertiesAggregateRouteConfiguration { + /* + * List of Ipv4Route prefixes. + */ + @JsonProperty(value = "ipv4Routes") + private List ipv4Routes; + + /* + * List of Ipv6Routes prefixes. + */ + @JsonProperty(value = "ipv6Routes") + private List ipv6Routes; + + /** Creates an instance of L3IsolationDomainPatchPropertiesAggregateRouteConfiguration class. */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration() { + } + + /** + * Get the ipv4Routes property: List of Ipv4Route prefixes. + * + * @return the ipv4Routes value. + */ + public List ipv4Routes() { + return this.ipv4Routes; + } + + /** + * Set the ipv4Routes property: List of Ipv4Route prefixes. + * + * @param ipv4Routes the ipv4Routes value to set. + * @return the L3IsolationDomainPatchPropertiesAggregateRouteConfiguration object itself. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration withIpv4Routes( + List ipv4Routes) { + this.ipv4Routes = ipv4Routes; + return this; + } + + /** + * Get the ipv6Routes property: List of Ipv6Routes prefixes. + * + * @return the ipv6Routes value. + */ + public List ipv6Routes() { + return this.ipv6Routes; + } + + /** + * Set the ipv6Routes property: List of Ipv6Routes prefixes. + * + * @param ipv6Routes the ipv6Routes value to set. + * @return the L3IsolationDomainPatchPropertiesAggregateRouteConfiguration object itself. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfiguration withIpv6Routes( + List ipv6Routes) { + this.ipv6Routes = ipv6Routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipv4Routes() != null) { + ipv4Routes().forEach(e -> e.validate()); + } + if (ipv6Routes() != null) { + ipv6Routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem.java new file mode 100644 index 000000000000..30e876de8e63 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** aggregateIpv4Route model. */ +@Fluent +public final class L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem { + /* + * IPv4 Prefix of the aggregate Ipv4Route. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem class. */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem() { + } + + /** + * Get the prefix property: IPv4 Prefix of the aggregate Ipv4Route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: IPv4 Prefix of the aggregate Ipv4Route. + * + * @param prefix the prefix value to set. + * @return the L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem object itself. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem.java new file mode 100644 index 000000000000..f419a1c792b5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** aggregateIpv6Route model. */ +@Fluent +public final class L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem { + /* + * IPv6 Prefix of the aggregate IPv6 Route. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem class. */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem() { + } + + /** + * Get the prefix property: IPv6 Prefix of the aggregate IPv6 Route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: IPv6 Prefix of the aggregate IPv6 Route. + * + * @param prefix the prefix value to set. + * @return the L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem object itself. + */ + public L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.java new file mode 100644 index 000000000000..2e9c3ac7918c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Connected Subnet RoutePolicy. */ +@Fluent +public final class L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy { + /* + * exportRoutePolicyId value. + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /* + * Enabled/Disabled connected subnet route policy. Ex: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /** Creates an instance of L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy class. */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy() { + } + + /** + * Get the exportRoutePolicyId property: exportRoutePolicyId value. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: exportRoutePolicyId value. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy object itself. + */ + public L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy withExportRoutePolicyId( + String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** + * Get the administrativeState property: Enabled/Disabled connected subnet route policy. Ex: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomains.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomains.java new file mode 100644 index 000000000000..2d215adc72c6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomains.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 L3IsolationDomains. */ +public interface L3IsolationDomains { + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @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 L3IsolationDomain resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String l3IsolationDomainName, Context context); + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition. + */ + L3IsolationDomain getByResourceGroup(String resourceGroupName, String l3IsolationDomainName); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 l3IsolationDomainName); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3 Isolation Domain. + * @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 l3IsolationDomainName, Context context); + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List L3IsolationDomains by resource group. + * + *

Displays L3IsolationDomains list by resource group GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List L3IsolationDomains by subscription. + * + *

Displays L3IsolationDomains list by subscription GET method. + * + * @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 list of L3IsolationDomains as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * executes enable operation to the underlying resources. + * + *

Enables racks for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body); + + /** + * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload. + * + *

Update administrative state of option B on CE devices. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 updateOptionBAdministrativeState( + String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearArpTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes clear ARP operation to the underlying resources. + * + *

Clears ARP tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 clearArpTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clearNeighborTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body); + + /** + * executes ipv6 clear neighbor tables operation to the underlying resources. + * + *

Clears IPv6 neighbor tables for this Isolation Domain. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3IsolationDomainName Name of the L3IsolationDomain. + * @param body Request payload. + * @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 clearNeighborTable( + String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context); + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @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 the L3IsolationDomain resource definition along with {@link Response}. + */ + L3IsolationDomain getById(String id); + + /** + * Gets a L3 Isolation Domain. + * + *

Retrieves details of this L3 Isolation Domain. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the L3IsolationDomain resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a L3 Isolation Domain. + * + *

Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. + * + * @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 L3IsolationDomain resource. + * + * @param name resource name. + * @return the first stage of the new L3IsolationDomain definition. + */ + L3IsolationDomain.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainsListResult.java new file mode 100644 index 000000000000..652bbc1d6e72 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of L3IsolationDomains. */ +@Fluent +public final class L3IsolationDomainsListResult { + /* + * List of L3IsolationDomain resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of L3IsolationDomainsListResult class. */ + public L3IsolationDomainsListResult() { + } + + /** + * Get the value property: List of L3IsolationDomain resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of L3IsolationDomain resources. + * + * @param value the value value to set. + * @return the L3IsolationDomainsListResult object itself. + */ + public L3IsolationDomainsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the L3IsolationDomainsListResult object itself. + */ + public L3IsolationDomainsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer2Configuration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer2Configuration.java new file mode 100644 index 000000000000..446cfb7cf00d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer2Configuration.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** layer2Configuration. */ +@Fluent +public class Layer2Configuration { + /* + * Number of ports connected between PE/CE. Maximum value depends on FabricSKU. + */ + @JsonProperty(value = "portCount") + private Integer portCount; + + /* + * MTU of the packets between PE & CE. + */ + @JsonProperty(value = "mtu", required = true) + private int mtu; + + /* + * List of network device interfaces resource IDs. + */ + @JsonProperty(value = "interfaces", access = JsonProperty.Access.WRITE_ONLY) + private List interfaces; + + /** Creates an instance of Layer2Configuration class. */ + public Layer2Configuration() { + } + + /** + * Get the portCount property: Number of ports connected between PE/CE. Maximum value depends on FabricSKU. + * + * @return the portCount value. + */ + public Integer portCount() { + return this.portCount; + } + + /** + * Set the portCount property: Number of ports connected between PE/CE. Maximum value depends on FabricSKU. + * + * @param portCount the portCount value to set. + * @return the Layer2Configuration object itself. + */ + public Layer2Configuration withPortCount(Integer portCount) { + this.portCount = portCount; + return this; + } + + /** + * Get the mtu property: MTU of the packets between PE & CE. + * + * @return the mtu value. + */ + public int mtu() { + return this.mtu; + } + + /** + * Set the mtu property: MTU of the packets between PE & CE. + * + * @param mtu the mtu value to set. + * @return the Layer2Configuration object itself. + */ + public Layer2Configuration withMtu(int mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the interfaces property: List of network device interfaces resource IDs. + * + * @return the interfaces value. + */ + public List interfaces() { + return this.interfaces; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3Configuration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3Configuration.java new file mode 100644 index 000000000000..542d3d8d48d5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3Configuration.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** layer3Configuration. */ +@Fluent +public final class Layer3Configuration extends Layer3IpPrefixPropertiesAutoGenerated { + /* + * importRoutePolicyId + */ + @JsonProperty(value = "importRoutePolicyId") + private String importRoutePolicyId; + + /* + * exportRoutePolicyId + */ + @JsonProperty(value = "exportRoutePolicyId") + private String exportRoutePolicyId; + + /* + * ASN of PE devices for CE/PE connectivity.Example : 28 + */ + @JsonProperty(value = "peerASN") + private Integer peerAsn; + + /* + * VLAN for CE/PE Layer 3 connectivity.Example : 501 + */ + @JsonProperty(value = "vlanId") + private Integer vlanId; + + /* + * ASN of CE devices for CE/PE connectivity. + */ + @JsonProperty(value = "fabricASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer fabricAsn; + + /** Creates an instance of Layer3Configuration class. */ + public Layer3Configuration() { + } + + /** + * Get the importRoutePolicyId property: importRoutePolicyId. + * + * @return the importRoutePolicyId value. + */ + public String importRoutePolicyId() { + return this.importRoutePolicyId; + } + + /** + * Set the importRoutePolicyId property: importRoutePolicyId. + * + * @param importRoutePolicyId the importRoutePolicyId value to set. + * @return the Layer3Configuration object itself. + */ + public Layer3Configuration withImportRoutePolicyId(String importRoutePolicyId) { + this.importRoutePolicyId = importRoutePolicyId; + return this; + } + + /** + * Get the exportRoutePolicyId property: exportRoutePolicyId. + * + * @return the exportRoutePolicyId value. + */ + public String exportRoutePolicyId() { + return this.exportRoutePolicyId; + } + + /** + * Set the exportRoutePolicyId property: exportRoutePolicyId. + * + * @param exportRoutePolicyId the exportRoutePolicyId value to set. + * @return the Layer3Configuration object itself. + */ + public Layer3Configuration withExportRoutePolicyId(String exportRoutePolicyId) { + this.exportRoutePolicyId = exportRoutePolicyId; + return this; + } + + /** + * Get the peerAsn property: ASN of PE devices for CE/PE connectivity.Example : 28. + * + * @return the peerAsn value. + */ + public Integer peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: ASN of PE devices for CE/PE connectivity.Example : 28. + * + * @param peerAsn the peerAsn value to set. + * @return the Layer3Configuration object itself. + */ + public Layer3Configuration withPeerAsn(Integer peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the vlanId property: VLAN for CE/PE Layer 3 connectivity.Example : 501. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: VLAN for CE/PE Layer 3 connectivity.Example : 501. + * + * @param vlanId the vlanId value to set. + * @return the Layer3Configuration object itself. + */ + public Layer3Configuration withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @return the fabricAsn value. + */ + public Integer fabricAsn() { + return this.fabricAsn; + } + + /** {@inheritDoc} */ + @Override + public Layer3Configuration withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3Configuration withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3Configuration withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3Configuration withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + super.withSecondaryIpv6Prefix(secondaryIpv6Prefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixProperties.java new file mode 100644 index 000000000000..590ea3c7e3ca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Layer 3 primary and secondary ip address prefixes. */ +@Fluent +public class Layer3IpPrefixProperties { + /* + * IPv4 Address Prefix of CE-PE interconnect links. Default value is 172.23.1.0/31. The values can be specified at + * the time of creation or can be updated afterwards. Any update to the values post-provisioning may disrupt + * traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs + * are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "primaryIpv4Prefix") + private String primaryIpv4Prefix; + + /* + * IPv6 Address Prefix of CE-PE interconnect links. Default value is 3FFE:FFFF:0:CD30::a1/126. The values can be + * specified at the time of creation or can be updated afterwards. Any update to the values post-provisioning may + * disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and + * 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "primaryIpv6Prefix") + private String primaryIpv6Prefix; + + /* + * Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is 172.23.1.2/31. The values can be + * specified at the time of creation or can be updated afterwards. Any update to the values post-provisioning may + * disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and + * 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "secondaryIpv4Prefix") + private String secondaryIpv4Prefix; + + /* + * Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is 3FFE:FFFF:0:CD30::a1/126. The values + * can be specified at the time of creation or can be updated afterwards. Any update to the values + * post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B + * interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "secondaryIpv6Prefix") + private String secondaryIpv6Prefix; + + /** Creates an instance of Layer3IpPrefixProperties class. */ + public Layer3IpPrefixProperties() { + } + + /** + * Get the primaryIpv4Prefix property: IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.23.1.0/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the primaryIpv4Prefix value. + */ + public String primaryIpv4Prefix() { + return this.primaryIpv4Prefix; + } + + /** + * Set the primaryIpv4Prefix property: IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.23.1.0/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param primaryIpv4Prefix the primaryIpv4Prefix value to set. + * @return the Layer3IpPrefixProperties object itself. + */ + public Layer3IpPrefixProperties withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + this.primaryIpv4Prefix = primaryIpv4Prefix; + return this; + } + + /** + * Get the primaryIpv6Prefix property: IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a1/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the primaryIpv6Prefix value. + */ + public String primaryIpv6Prefix() { + return this.primaryIpv6Prefix; + } + + /** + * Set the primaryIpv6Prefix property: IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a1/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param primaryIpv6Prefix the primaryIpv6Prefix value to set. + * @return the Layer3IpPrefixProperties object itself. + */ + public Layer3IpPrefixProperties withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + this.primaryIpv6Prefix = primaryIpv6Prefix; + return this; + } + + /** + * Get the secondaryIpv4Prefix property: Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.23.1.2/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the secondaryIpv4Prefix value. + */ + public String secondaryIpv4Prefix() { + return this.secondaryIpv4Prefix; + } + + /** + * Set the secondaryIpv4Prefix property: Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.23.1.2/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param secondaryIpv4Prefix the secondaryIpv4Prefix value to set. + * @return the Layer3IpPrefixProperties object itself. + */ + public Layer3IpPrefixProperties withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + this.secondaryIpv4Prefix = secondaryIpv4Prefix; + return this; + } + + /** + * Get the secondaryIpv6Prefix property: Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a1/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the secondaryIpv6Prefix value. + */ + public String secondaryIpv6Prefix() { + return this.secondaryIpv6Prefix; + } + + /** + * Set the secondaryIpv6Prefix property: Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a1/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param secondaryIpv6Prefix the secondaryIpv6Prefix value to set. + * @return the Layer3IpPrefixProperties object itself. + */ + public Layer3IpPrefixProperties withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + this.secondaryIpv6Prefix = secondaryIpv6Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixPropertiesAutoGenerated.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixPropertiesAutoGenerated.java new file mode 100644 index 000000000000..5ce64a3075cd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixPropertiesAutoGenerated.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Layer 3 primary and secondary ip address prefixes. */ +@Fluent +public class Layer3IpPrefixPropertiesAutoGenerated { + /* + * IPv4 Address Prefix of CE-PE interconnect links. Default value is 172.31.0.0/31. The values can be specified at + * the time of creation or can be updated afterwards. Any update to the values post-provisioning may disrupt + * traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and 4th IPs + * are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "primaryIpv4Prefix") + private String primaryIpv4Prefix; + + /* + * IPv6 Address Prefix of CE-PE interconnect links. Default value is 3FFE:FFFF:0:CD30::a0/126. The values can be + * specified at the time of creation or can be updated afterwards. Any update to the values post-provisioning may + * disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and + * 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "primaryIpv6Prefix") + private String primaryIpv6Prefix; + + /* + * Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is 172.31.0.20/31. The values can be + * specified at the time of creation or can be updated afterwards. Any update to the values post-provisioning may + * disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B interfaces. The 2nd and + * 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "secondaryIpv4Prefix") + private String secondaryIpv4Prefix; + + /* + * Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is 3FFE:FFFF:0:CD30::a4/126. The values + * can be specified at the time of creation or can be updated afterwards. Any update to the values + * post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for Option B + * interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + */ + @JsonProperty(value = "secondaryIpv6Prefix") + private String secondaryIpv6Prefix; + + /** Creates an instance of Layer3IpPrefixPropertiesAutoGenerated class. */ + public Layer3IpPrefixPropertiesAutoGenerated() { + } + + /** + * Get the primaryIpv4Prefix property: IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.31.0.0/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the primaryIpv4Prefix value. + */ + public String primaryIpv4Prefix() { + return this.primaryIpv4Prefix; + } + + /** + * Set the primaryIpv4Prefix property: IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.31.0.0/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param primaryIpv4Prefix the primaryIpv4Prefix value to set. + * @return the Layer3IpPrefixPropertiesAutoGenerated object itself. + */ + public Layer3IpPrefixPropertiesAutoGenerated withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + this.primaryIpv4Prefix = primaryIpv4Prefix; + return this; + } + + /** + * Get the primaryIpv6Prefix property: IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the primaryIpv6Prefix value. + */ + public String primaryIpv6Prefix() { + return this.primaryIpv6Prefix; + } + + /** + * Set the primaryIpv6Prefix property: IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a0/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param primaryIpv6Prefix the primaryIpv6Prefix value to set. + * @return the Layer3IpPrefixPropertiesAutoGenerated object itself. + */ + public Layer3IpPrefixPropertiesAutoGenerated withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + this.primaryIpv6Prefix = primaryIpv6Prefix; + return this; + } + + /** + * Get the secondaryIpv4Prefix property: Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.31.0.20/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the secondaryIpv4Prefix value. + */ + public String secondaryIpv4Prefix() { + return this.secondaryIpv4Prefix; + } + + /** + * Set the secondaryIpv4Prefix property: Secondary IPv4 Address Prefix of CE-PE interconnect links. Default value is + * 172.31.0.20/31. The values can be specified at the time of creation or can be updated afterwards. Any update to + * the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and CE2 for + * Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param secondaryIpv4Prefix the secondaryIpv4Prefix value to set. + * @return the Layer3IpPrefixPropertiesAutoGenerated object itself. + */ + public Layer3IpPrefixPropertiesAutoGenerated withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + this.secondaryIpv4Prefix = secondaryIpv4Prefix; + return this; + } + + /** + * Get the secondaryIpv6Prefix property: Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a4/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @return the secondaryIpv6Prefix value. + */ + public String secondaryIpv6Prefix() { + return this.secondaryIpv6Prefix; + } + + /** + * Set the secondaryIpv6Prefix property: Secondary IPv6 Address Prefix of CE-PE interconnect links. Default value is + * 3FFE:FFFF:0:CD30::a4/126. The values can be specified at the time of creation or can be updated afterwards. Any + * update to the values post-provisioning may disrupt traffic. The 1st and 3rd IPs are to be configured on CE1 and + * CE2 for Option B interfaces. The 2nd and 4th IPs are to be configured on PE1 and PE2 for Option B interfaces. + * + * @param secondaryIpv6Prefix the secondaryIpv6Prefix value to set. + * @return the Layer3IpPrefixPropertiesAutoGenerated object itself. + */ + public Layer3IpPrefixPropertiesAutoGenerated withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + this.secondaryIpv6Prefix = secondaryIpv6Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/LocalASBoolean.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/LocalASBoolean.java new file mode 100644 index 000000000000..34aa484121fe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/LocalASBoolean.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Local Autonomous System. Example: true | false. */ +public final class LocalASBoolean extends ExpandableStringEnum { + /** Static value true for LocalASBoolean. */ + public static final LocalASBoolean TRUE = fromString("true"); + + /** Static value false for LocalASBoolean. */ + public static final LocalASBoolean FALSE = fromString("false"); + + /** + * Creates a new instance of LocalASBoolean value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LocalASBoolean() { + } + + /** + * Creates or finds a LocalASBoolean from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalASBoolean. + */ + @JsonCreator + public static LocalASBoolean fromString(String name) { + return fromString(name, LocalASBoolean.class); + } + + /** + * Gets known LocalASBoolean values. + * + * @return known LocalASBoolean values. + */ + public static Collection values() { + return values(LocalASBoolean.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevice.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevice.java new file mode 100644 index 000000000000..797c8dd38f0b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevice.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkDevice. */ +public interface NetworkDevice { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the version property: Current version of the device as defined in SKU. + * + * @return the version value. + */ + String version(); + + /** + * Gets the networkDeviceSku property: Network Device SKU name. + * + * @return the networkDeviceSku value. + */ + String networkDeviceSku(); + + /** + * Gets the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR. + * + * @return the networkDeviceRole value. + */ + NetworkDeviceRoleTypes networkDeviceRole(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the networkRackId property: Reference to network rack resource id. + * + * @return the networkRackId value. + */ + String networkRackId(); + + /** + * Gets the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner object. + * + * @return the inner object. + */ + NetworkDeviceInner innerModel(); + + /** The entirety of the NetworkDevice definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkDevice definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkDevice definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkDevice 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 NetworkDevice 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkDevice 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.WithNetworkDeviceSku, + DefinitionStages.WithNetworkDeviceRole, + DefinitionStages.WithHostname, + DefinitionStages.WithSerialNumber, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkDevice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkDevice create(Context context); + } + /** The stage of the NetworkDevice 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 NetworkDevice definition allowing to specify networkDeviceSku. */ + interface WithNetworkDeviceSku { + /** + * Specifies the networkDeviceSku property: Network Device SKU name.. + * + * @param networkDeviceSku Network Device SKU name. + * @return the next definition stage. + */ + WithCreate withNetworkDeviceSku(String networkDeviceSku); + } + /** The stage of the NetworkDevice definition allowing to specify networkDeviceRole. */ + interface WithNetworkDeviceRole { + /** + * Specifies the networkDeviceRole property: networkDeviceRole is the device role: Example: CE | ToR.. + * + * @param networkDeviceRole networkDeviceRole is the device role: Example: CE | ToR. + * @return the next definition stage. + */ + WithCreate withNetworkDeviceRole(NetworkDeviceRoleTypes networkDeviceRole); + } + /** The stage of the NetworkDevice definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The host Name of the device.. + * + * @param hostname The host Name of the device. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + /** The stage of the NetworkDevice definition allowing to specify serialNumber. */ + interface WithSerialNumber { + /** + * Specifies the serialNumber property: serialNumber of the format + * Make;Model;HardwareRevisionId;SerialNumber. Example: Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * @return the next definition stage. + */ + WithCreate withSerialNumber(String serialNumber); + } + /** The stage of the NetworkDevice definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the NetworkDevice resource. + * + * @return the stage of resource update. + */ + NetworkDevice.Update update(); + + /** The template for NetworkDevice update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithHostname, + UpdateStages.WithSerialNumber, + UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkDevice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkDevice apply(Context context); + } + /** The NetworkDevice update stages. */ + interface UpdateStages { + /** The stage of the NetworkDevice update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags that will replace the existing ones.. + * + * @param tags Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NetworkDevice update allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: The host Name of the device.. + * + * @param hostname The host Name of the device. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + /** The stage of the NetworkDevice update allowing to specify serialNumber. */ + interface WithSerialNumber { + /** + * Specifies the serialNumber property: serialNumber of the format + * Make;Model;HardwareRevisionId;SerialNumber. Example: Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * @return the next definition stage. + */ + Update withSerialNumber(String serialNumber); + } + /** The stage of the NetworkDevice update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkDevice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkDevice refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @throws com.azure.core.management.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 reboot(); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @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 reboot(Context context); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @throws com.azure.core.management.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 restoreConfig(); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @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 restoreConfig(Context context); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateVersion(UpdateVersionProperties body); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param body Request payload. + * @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 updateVersion(UpdateVersionProperties body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties. + */ + SupportPackageProperties generateSupportPackage(); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @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 generate support package post action properties. + */ + SupportPackageProperties generateSupportPackage(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updatePowerCycle(UpdatePowerCycleProperties body); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param body Request payload. + * @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 updatePowerCycle(UpdatePowerCycleProperties body, Context context); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device. + */ + GetDeviceStatusProperties getStatus(); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @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 running status of the Network Device. + */ + GetDeviceStatusProperties getStatus(Context context); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device. + */ + List getStaticInterfaceMaps(); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @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 static interface maps for the given Network Device. + */ + List getStaticInterfaceMaps(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device. + */ + List getDynamicInterfaceMaps(); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @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 dynamic interface maps for the given Network Device. + */ + List getDynamicInterfaceMaps(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchParameters.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchParameters.java new file mode 100644 index 000000000000..e9f5256b0478 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchParameters.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDevicePatchParametersProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NetworkDevicePatchParameters resource definition. */ +@Fluent +public final class NetworkDevicePatchParameters { + /* + * Network Device Patch properties. + */ + @JsonProperty(value = "properties") + private NetworkDevicePatchParametersProperties innerProperties; + + /* + * Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of NetworkDevicePatchParameters class. */ + public NetworkDevicePatchParameters() { + } + + /** + * Get the innerProperties property: Network Device Patch properties. + * + * @return the innerProperties value. + */ + private NetworkDevicePatchParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the NetworkDevicePatchParameters object itself. + */ + public NetworkDevicePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: The host Name of the device. + * + * @param hostname the hostname value to set. + * @return the NetworkDevicePatchParameters object itself. + */ + public NetworkDevicePatchParameters withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDevicePatchParametersProperties(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Set the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkDevicePatchParameters object itself. + */ + public NetworkDevicePatchParameters withSerialNumber(String serialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDevicePatchParametersProperties(); + } + this.innerProperties().withSerialNumber(serialNumber); + return this; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkDevicePatchParameters object itself. + */ + public NetworkDevicePatchParameters withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkDevicePatchParametersProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchableProperties.java new file mode 100644 index 000000000000..74ad53686dfc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchableProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Device updatable properties. */ +@Fluent +public class NetworkDevicePatchableProperties { + /* + * The host Name of the device. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969 + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of NetworkDevicePatchableProperties class. */ + public NetworkDevicePatchableProperties() { + } + + /** + * Get the hostname property: The host Name of the device. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host Name of the device. + * + * @param hostname the hostname value to set. + * @return the NetworkDevicePatchableProperties object itself. + */ + public NetworkDevicePatchableProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: serialNumber of the format Make;Model;HardwareRevisionId;SerialNumber. Example: + * Arista;DCS-7280DR3-24;12.05;JPE21116969. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkDevicePatchableProperties object itself. + */ + public NetworkDevicePatchableProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRackRoleType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRackRoleType.java new file mode 100644 index 000000000000..6190a24f1055 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRackRoleType.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Role for the network device. */ +public final class NetworkDeviceRackRoleType extends ExpandableStringEnum { + /** Static value CE for NetworkDeviceRackRoleType. */ + public static final NetworkDeviceRackRoleType CE = fromString("CE"); + + /** Static value ToR for NetworkDeviceRackRoleType. */ + public static final NetworkDeviceRackRoleType TOR = fromString("ToR"); + + /** Static value NPB for NetworkDeviceRackRoleType. */ + public static final NetworkDeviceRackRoleType NPB = fromString("NPB"); + + /** Static value TS for NetworkDeviceRackRoleType. */ + public static final NetworkDeviceRackRoleType TS = fromString("TS"); + + /** Static value Management for NetworkDeviceRackRoleType. */ + public static final NetworkDeviceRackRoleType MANAGEMENT = fromString("Management"); + + /** + * Creates a new instance of NetworkDeviceRackRoleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkDeviceRackRoleType() { + } + + /** + * Creates or finds a NetworkDeviceRackRoleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkDeviceRackRoleType. + */ + @JsonCreator + public static NetworkDeviceRackRoleType fromString(String name) { + return fromString(name, NetworkDeviceRackRoleType.class); + } + + /** + * Gets known NetworkDeviceRackRoleType values. + * + * @return known NetworkDeviceRackRoleType values. + */ + public static Collection values() { + return values(NetworkDeviceRackRoleType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleName.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleName.java new file mode 100644 index 000000000000..205a33c4ffc5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleName.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Available roles for the network device. */ +public final class NetworkDeviceRoleName extends ExpandableStringEnum { + /** Static value CE for NetworkDeviceRoleName. */ + public static final NetworkDeviceRoleName CE = fromString("CE"); + + /** Static value ToR for NetworkDeviceRoleName. */ + public static final NetworkDeviceRoleName TOR = fromString("ToR"); + + /** Static value NPB for NetworkDeviceRoleName. */ + public static final NetworkDeviceRoleName NPB = fromString("NPB"); + + /** Static value TS for NetworkDeviceRoleName. */ + public static final NetworkDeviceRoleName TS = fromString("TS"); + + /** Static value Management for NetworkDeviceRoleName. */ + public static final NetworkDeviceRoleName MANAGEMENT = fromString("Management"); + + /** + * Creates a new instance of NetworkDeviceRoleName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkDeviceRoleName() { + } + + /** + * Creates or finds a NetworkDeviceRoleName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkDeviceRoleName. + */ + @JsonCreator + public static NetworkDeviceRoleName fromString(String name) { + return fromString(name, NetworkDeviceRoleName.class); + } + + /** + * Gets known NetworkDeviceRoleName values. + * + * @return known NetworkDeviceRoleName values. + */ + public static Collection values() { + return values(NetworkDeviceRoleName.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleTypes.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleTypes.java new file mode 100644 index 000000000000..91e736618b21 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleTypes.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Available roles for the network device. */ +public final class NetworkDeviceRoleTypes extends ExpandableStringEnum { + /** Static value CE for NetworkDeviceRoleTypes. */ + public static final NetworkDeviceRoleTypes CE = fromString("CE"); + + /** Static value ToR for NetworkDeviceRoleTypes. */ + public static final NetworkDeviceRoleTypes TOR = fromString("ToR"); + + /** Static value NPB for NetworkDeviceRoleTypes. */ + public static final NetworkDeviceRoleTypes NPB = fromString("NPB"); + + /** Static value TS for NetworkDeviceRoleTypes. */ + public static final NetworkDeviceRoleTypes TS = fromString("TS"); + + /** Static value Management for NetworkDeviceRoleTypes. */ + public static final NetworkDeviceRoleTypes MANAGEMENT = fromString("Management"); + + /** + * Creates a new instance of NetworkDeviceRoleTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkDeviceRoleTypes() { + } + + /** + * Creates or finds a NetworkDeviceRoleTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkDeviceRoleTypes. + */ + @JsonCreator + public static NetworkDeviceRoleTypes fromString(String name) { + return fromString(name, NetworkDeviceRoleTypes.class); + } + + /** + * Gets known NetworkDeviceRoleTypes values. + * + * @return known NetworkDeviceRoleTypes values. + */ + public static Collection values() { + return values(NetworkDeviceRoleTypes.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java new file mode 100644 index 000000000000..954f45faa74e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.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.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; +import java.util.List; + +/** An immutable client-side representation of NetworkDeviceSku. */ +public interface NetworkDeviceSku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the model property: Model of the network device. + * + * @return the model value. + */ + String model(); + + /** + * Gets the manufacturer property: Manufacturer of the network device. + * + * @return the manufacturer value. + */ + String manufacturer(); + + /** + * Gets the supportedVersions property: List of network device interfaces. + * + * @return the supportedVersions value. + */ + List supportedVersions(); + + /** + * Gets the limits property: Network device limits. + * + * @return the limits value. + */ + NetworkDeviceSkuPropertiesLimits limits(); + + /** + * Gets the supportedRoleTypes property: Available roles for the network device. + * + * @return the supportedRoleTypes value. + */ + List supportedRoleTypes(); + + /** + * Gets the interfaces property: List of network device interfaces. + * + * @return the interfaces value. + */ + List interfaces(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner object. + * + * @return the inner object. + */ + NetworkDeviceSkuInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesItem.java new file mode 100644 index 000000000000..7e13c08635ea --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network device interface properties. */ +@Fluent +public final class NetworkDeviceSkuPropertiesInterfacesItem { + /* + * Interface identifier. Example: HundredGigE0/0. + */ + @JsonProperty(value = "identifier") + private String identifier; + + /* + * Interface type. + */ + @JsonProperty(value = "interfaceType") + private String interfaceType; + + /* + * List of supported connector types. + */ + @JsonProperty(value = "supportedConnectorTypes") + private List supportedConnectorTypes; + + /** Creates an instance of NetworkDeviceSkuPropertiesInterfacesItem class. */ + public NetworkDeviceSkuPropertiesInterfacesItem() { + } + + /** + * Get the identifier property: Interface identifier. Example: HundredGigE0/0. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Interface identifier. Example: HundredGigE0/0. + * + * @param identifier the identifier value to set. + * @return the NetworkDeviceSkuPropertiesInterfacesItem object itself. + */ + public NetworkDeviceSkuPropertiesInterfacesItem withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the interfaceType property: Interface type. + * + * @return the interfaceType value. + */ + public String interfaceType() { + return this.interfaceType; + } + + /** + * Set the interfaceType property: Interface type. + * + * @param interfaceType the interfaceType value to set. + * @return the NetworkDeviceSkuPropertiesInterfacesItem object itself. + */ + public NetworkDeviceSkuPropertiesInterfacesItem withInterfaceType(String interfaceType) { + this.interfaceType = interfaceType; + return this; + } + + /** + * Get the supportedConnectorTypes property: List of supported connector types. + * + * @return the supportedConnectorTypes value. + */ + public List supportedConnectorTypes() { + return this.supportedConnectorTypes; + } + + /** + * Set the supportedConnectorTypes property: List of supported connector types. + * + * @param supportedConnectorTypes the supportedConnectorTypes value to set. + * @return the NetworkDeviceSkuPropertiesInterfacesItem object itself. + */ + public NetworkDeviceSkuPropertiesInterfacesItem withSupportedConnectorTypes( + List supportedConnectorTypes) { + this.supportedConnectorTypes = supportedConnectorTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedConnectorTypes() != null) { + supportedConnectorTypes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem.java new file mode 100644 index 000000000000..ddddc072cfad --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported connector properties. */ +@Fluent +public final class NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem { + /* + * Connector type. Example: Optical. + */ + @JsonProperty(value = "connectorType") + private String connectorType; + + /* + * Maximum speed of the connector in Mbps. + */ + @JsonProperty(value = "maxSpeedInMbps") + private Integer maxSpeedInMbps; + + /** Creates an instance of NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem class. */ + public NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem() { + } + + /** + * Get the connectorType property: Connector type. Example: Optical. + * + * @return the connectorType value. + */ + public String connectorType() { + return this.connectorType; + } + + /** + * Set the connectorType property: Connector type. Example: Optical. + * + * @param connectorType the connectorType value to set. + * @return the NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem object itself. + */ + public NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem withConnectorType(String connectorType) { + this.connectorType = connectorType; + return this; + } + + /** + * Get the maxSpeedInMbps property: Maximum speed of the connector in Mbps. + * + * @return the maxSpeedInMbps value. + */ + public Integer maxSpeedInMbps() { + return this.maxSpeedInMbps; + } + + /** + * Set the maxSpeedInMbps property: Maximum speed of the connector in Mbps. + * + * @param maxSpeedInMbps the maxSpeedInMbps value to set. + * @return the NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem object itself. + */ + public NetworkDeviceSkuPropertiesInterfacesPropertiesItemsItem withMaxSpeedInMbps(Integer maxSpeedInMbps) { + this.maxSpeedInMbps = maxSpeedInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesLimits.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesLimits.java new file mode 100644 index 000000000000..2fe7e712492e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesLimits.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network device limits. */ +@Fluent +public final class NetworkDeviceSkuPropertiesLimits { + /* + * Maximum number of physical interfaces. + */ + @JsonProperty(value = "physicalInterfaceCount") + private Integer physicalInterfaceCount; + + /* + * Maximum number of sub-interfaces. + */ + @JsonProperty(value = "maxSubInterfaces") + private Integer maxSubInterfaces; + + /* + * Maximum number of tunnel interfaces. + */ + @JsonProperty(value = "maxTunnelInterfaces") + private Integer maxTunnelInterfaces; + + /* + * Maximum number of virtual router functions. + */ + @JsonProperty(value = "maxVirtualRouterFunctions") + private Integer maxVirtualRouterFunctions; + + /* + * Maximum number of Border Gateway Protocol (BGP) peers. + */ + @JsonProperty(value = "maxBorderGatewayProtocolPeers") + private Integer maxBorderGatewayProtocolPeers; + + /* + * Maximum number of Bidirectional Forwarding Detection (BFD) peers. + */ + @JsonProperty(value = "maxBidirectionalForwardingDetectionPeers") + private Integer maxBidirectionalForwardingDetectionPeers; + + /** Creates an instance of NetworkDeviceSkuPropertiesLimits class. */ + public NetworkDeviceSkuPropertiesLimits() { + } + + /** + * Get the physicalInterfaceCount property: Maximum number of physical interfaces. + * + * @return the physicalInterfaceCount value. + */ + public Integer physicalInterfaceCount() { + return this.physicalInterfaceCount; + } + + /** + * Set the physicalInterfaceCount property: Maximum number of physical interfaces. + * + * @param physicalInterfaceCount the physicalInterfaceCount value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withPhysicalInterfaceCount(Integer physicalInterfaceCount) { + this.physicalInterfaceCount = physicalInterfaceCount; + return this; + } + + /** + * Get the maxSubInterfaces property: Maximum number of sub-interfaces. + * + * @return the maxSubInterfaces value. + */ + public Integer maxSubInterfaces() { + return this.maxSubInterfaces; + } + + /** + * Set the maxSubInterfaces property: Maximum number of sub-interfaces. + * + * @param maxSubInterfaces the maxSubInterfaces value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withMaxSubInterfaces(Integer maxSubInterfaces) { + this.maxSubInterfaces = maxSubInterfaces; + return this; + } + + /** + * Get the maxTunnelInterfaces property: Maximum number of tunnel interfaces. + * + * @return the maxTunnelInterfaces value. + */ + public Integer maxTunnelInterfaces() { + return this.maxTunnelInterfaces; + } + + /** + * Set the maxTunnelInterfaces property: Maximum number of tunnel interfaces. + * + * @param maxTunnelInterfaces the maxTunnelInterfaces value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withMaxTunnelInterfaces(Integer maxTunnelInterfaces) { + this.maxTunnelInterfaces = maxTunnelInterfaces; + return this; + } + + /** + * Get the maxVirtualRouterFunctions property: Maximum number of virtual router functions. + * + * @return the maxVirtualRouterFunctions value. + */ + public Integer maxVirtualRouterFunctions() { + return this.maxVirtualRouterFunctions; + } + + /** + * Set the maxVirtualRouterFunctions property: Maximum number of virtual router functions. + * + * @param maxVirtualRouterFunctions the maxVirtualRouterFunctions value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withMaxVirtualRouterFunctions(Integer maxVirtualRouterFunctions) { + this.maxVirtualRouterFunctions = maxVirtualRouterFunctions; + return this; + } + + /** + * Get the maxBorderGatewayProtocolPeers property: Maximum number of Border Gateway Protocol (BGP) peers. + * + * @return the maxBorderGatewayProtocolPeers value. + */ + public Integer maxBorderGatewayProtocolPeers() { + return this.maxBorderGatewayProtocolPeers; + } + + /** + * Set the maxBorderGatewayProtocolPeers property: Maximum number of Border Gateway Protocol (BGP) peers. + * + * @param maxBorderGatewayProtocolPeers the maxBorderGatewayProtocolPeers value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withMaxBorderGatewayProtocolPeers(Integer maxBorderGatewayProtocolPeers) { + this.maxBorderGatewayProtocolPeers = maxBorderGatewayProtocolPeers; + return this; + } + + /** + * Get the maxBidirectionalForwardingDetectionPeers property: Maximum number of Bidirectional Forwarding Detection + * (BFD) peers. + * + * @return the maxBidirectionalForwardingDetectionPeers value. + */ + public Integer maxBidirectionalForwardingDetectionPeers() { + return this.maxBidirectionalForwardingDetectionPeers; + } + + /** + * Set the maxBidirectionalForwardingDetectionPeers property: Maximum number of Bidirectional Forwarding Detection + * (BFD) peers. + * + * @param maxBidirectionalForwardingDetectionPeers the maxBidirectionalForwardingDetectionPeers value to set. + * @return the NetworkDeviceSkuPropertiesLimits object itself. + */ + public NetworkDeviceSkuPropertiesLimits withMaxBidirectionalForwardingDetectionPeers( + Integer maxBidirectionalForwardingDetectionPeers) { + this.maxBidirectionalForwardingDetectionPeers = maxBidirectionalForwardingDetectionPeers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesSupportedVersionsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesSupportedVersionsItem.java new file mode 100644 index 000000000000..ffb462fba06f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkuPropertiesSupportedVersionsItem.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network device interface properties. */ +@Fluent +public final class NetworkDeviceSkuPropertiesSupportedVersionsItem { + /* + * Operating system and firmware combined versions. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Operating system version. + */ + @JsonProperty(value = "vendorOsVersion") + private String vendorOsVersion; + + /* + * Firmware version. + */ + @JsonProperty(value = "vendorFirmwareVersion") + private String vendorFirmwareVersion; + + /* + * If the current version is in use. + */ + @JsonProperty(value = "isCurrent") + private IsCurrentVersion isCurrent; + + /* + * If the current version is a test version. + */ + @JsonProperty(value = "isTest") + private IsTestVersion isTest; + + /** Creates an instance of NetworkDeviceSkuPropertiesSupportedVersionsItem class. */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem() { + } + + /** + * Get the version property: Operating system and firmware combined versions. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Operating system and firmware combined versions. + * + * @param version the version value to set. + * @return the NetworkDeviceSkuPropertiesSupportedVersionsItem object itself. + */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the vendorOsVersion property: Operating system version. + * + * @return the vendorOsVersion value. + */ + public String vendorOsVersion() { + return this.vendorOsVersion; + } + + /** + * Set the vendorOsVersion property: Operating system version. + * + * @param vendorOsVersion the vendorOsVersion value to set. + * @return the NetworkDeviceSkuPropertiesSupportedVersionsItem object itself. + */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem withVendorOsVersion(String vendorOsVersion) { + this.vendorOsVersion = vendorOsVersion; + return this; + } + + /** + * Get the vendorFirmwareVersion property: Firmware version. + * + * @return the vendorFirmwareVersion value. + */ + public String vendorFirmwareVersion() { + return this.vendorFirmwareVersion; + } + + /** + * Set the vendorFirmwareVersion property: Firmware version. + * + * @param vendorFirmwareVersion the vendorFirmwareVersion value to set. + * @return the NetworkDeviceSkuPropertiesSupportedVersionsItem object itself. + */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem withVendorFirmwareVersion(String vendorFirmwareVersion) { + this.vendorFirmwareVersion = vendorFirmwareVersion; + return this; + } + + /** + * Get the isCurrent property: If the current version is in use. + * + * @return the isCurrent value. + */ + public IsCurrentVersion isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: If the current version is in use. + * + * @param isCurrent the isCurrent value to set. + * @return the NetworkDeviceSkuPropertiesSupportedVersionsItem object itself. + */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem withIsCurrent(IsCurrentVersion isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the isTest property: If the current version is a test version. + * + * @return the isTest value. + */ + public IsTestVersion isTest() { + return this.isTest; + } + + /** + * Set the isTest property: If the current version is a test version. + * + * @param isTest the isTest value to set. + * @return the NetworkDeviceSkuPropertiesSupportedVersionsItem object itself. + */ + public NetworkDeviceSkuPropertiesSupportedVersionsItem withIsTest(IsTestVersion isTest) { + this.isTest = isTest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkus.java new file mode 100644 index 000000000000..b30b9889bd00 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkDeviceSkus. */ +public interface NetworkDeviceSkus { + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @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 Device SKU details along with {@link Response}. + */ + Response getWithResponse(String networkDeviceSkuName, Context context); + + /** + * Gets a Network Device Sku. + * + *

Get Network Device SKU details. + * + * @param networkDeviceSkuName Name of the Network Device Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Device SKU details. + */ + NetworkDeviceSku get(String networkDeviceSkuName); + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkDeviceSkus by subscription. + * + *

List Network Device SKUs for the given 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 list of NetworkDeviceSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkusListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkusListResult.java new file mode 100644 index 000000000000..31628d598c7c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkusListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkDeviceSkus. */ +@Fluent +public final class NetworkDeviceSkusListResult { + /* + * List of NetworkDeviceSku resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkDeviceSkusListResult class. */ + public NetworkDeviceSkusListResult() { + } + + /** + * Get the value property: List of NetworkDeviceSku resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkDeviceSku resources. + * + * @param value the value value to set. + * @return the NetworkDeviceSkusListResult object itself. + */ + public NetworkDeviceSkusListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkDeviceSkusListResult object itself. + */ + public NetworkDeviceSkusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevices.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevices.java new file mode 100644 index 000000000000..7084859ef89b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevices.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of NetworkDevices. */ +public interface NetworkDevices { + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @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 Network Device resource details along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details. + */ + NetworkDevice getByResourceGroup(String resourceGroupName, String networkDeviceName); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkDeviceName); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the Network Device. + * @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 networkDeviceName, Context context); + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkDevices by resource group. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkDevices by subscription. + * + *

List all the Network Device resources in a given 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 list of NetworkDevices as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reboot(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Reboot the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 reboot(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restoreConfig(String resourceGroupName, String networkDeviceName); + + /** + * Restores the configuration to last applied good configuration from Azure. + * + *

Restore the configuration of the Network Device resource to last known good configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 restoreConfig(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateVersion(String resourceGroupName, String networkDeviceName, UpdateVersionProperties body); + + /** + * Implements SKU version upgrade of network device. + * + *

Update the SKU version of the Network Device resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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 updateVersion( + String resourceGroupName, String networkDeviceName, UpdateVersionProperties body, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate support package post action properties. + */ + SupportPackageProperties generateSupportPackage(String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Generate Support Package for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 generate support package post action properties. + */ + SupportPackageProperties generateSupportPackage( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updatePowerCycle(String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body); + + /** + * Implements the operation to the underlying resources. + * + *

Update PDU power cycle of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param body Request payload. + * @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 updatePowerCycle( + String resourceGroupName, String networkDeviceName, UpdatePowerCycleProperties body, Context context); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Device. + */ + GetDeviceStatusProperties getStatus(String resourceGroupName, String networkDeviceName); + + /** + * Gets the running status of the network device. + * + *

Get the running status of the Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 running status of the Network Device. + */ + GetDeviceStatusProperties getStatus(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the static interface maps for the given Network Device. + */ + List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName); + + /** + * Show the interface maps as per the topology. + * + *

Get the static interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 static interface maps for the given Network Device. + */ + List getStaticInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the dynamic interface maps for the given Network Device. + */ + List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the dynamic interface maps for the given Network Device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 dynamic interface maps for the given Network Device. + */ + List getDynamicInterfaceMaps( + String resourceGroupName, String networkDeviceName, Context context); + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @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 the Network Device resource details along with {@link Response}. + */ + NetworkDevice getById(String id); + + /** + * Gets a Network Device. + * + *

Get the Network Device resource details. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Device resource details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Network Device. + * + *

Delete the Network Device resource. + * + * @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 NetworkDevice resource. + * + * @param name resource name. + * @return the first stage of the new NetworkDevice definition. + */ + NetworkDevice.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicesListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicesListResult.java new file mode 100644 index 000000000000..95bd2092dcc7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicesListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkDeviceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkDevices. */ +@Fluent +public final class NetworkDevicesListResult { + /* + * List of NetworkDevice resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkDevicesListResult class. */ + public NetworkDevicesListResult() { + } + + /** + * Get the value property: List of NetworkDevice resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkDevice resources. + * + * @param value the value value to set. + * @return the NetworkDevicesListResult object itself. + */ + public NetworkDevicesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkDevicesListResult object itself. + */ + public NetworkDevicesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java new file mode 100644 index 000000000000..3dd1aa062bec --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkFabric. */ +public interface NetworkFabric { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the + * user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines + * whether it is a single / multi rack Network Fabric. + * + * @return the networkFabricSku value. + */ + String networkFabricSku(); + + /** + * Gets the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8. + * + * @return the rackCount value. + */ + int rackCount(); + + /** + * Gets the serverCountPerRack property: Number of servers.Possible values are from 1-16. + * + * @return the serverCountPerRack value. + */ + int serverCountPerRack(); + + /** + * Gets the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * + * @return the ipv4Prefix value. + */ + String ipv4Prefix(); + + /** + * Gets the ipv6Prefix property: IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * + * @return the ipv6Prefix value. + */ + String ipv6Prefix(); + + /** + * Gets the routerId property: Router Id of CE to be used for MP-BGP between PE and CE. + * + * @return the routerId value. + */ + String routerId(); + + /** + * Gets the fabricAsn property: ASN of CE devices for CE/PE connectivity. + * + * @return the fabricAsn value. + */ + int fabricAsn(); + + /** + * Gets the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * + * @return the networkFabricControllerId value. + */ + String networkFabricControllerId(); + + /** + * Gets the terminalServerConfiguration property: Network and credentials configuration currently applied to + * terminal server. + * + * @return the terminalServerConfiguration value. + */ + NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration(); + + /** + * Gets the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @return the managementNetworkConfiguration value. + */ + NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration(); + + /** + * Gets the operationalState property: Gets the operational state of the resource. + * + * @return the operationalState value. + */ + NetworkFabricOperationalState operationalState(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + List racks(); + + /** + * Gets the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + List l2IsolationDomains(); + + /** + * Gets the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + List l3IsolationDomains(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner object. + * + * @return the inner object. + */ + NetworkFabricInner innerModel(); + + /** The entirety of the NetworkFabric definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkFabric definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkFabric definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkFabric 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 NetworkFabric 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkFabric 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.WithNetworkFabricSku, + DefinitionStages.WithRackCount, + DefinitionStages.WithServerCountPerRack, + DefinitionStages.WithIpv4Prefix, + DefinitionStages.WithIpv6Prefix, + DefinitionStages.WithFabricAsn, + DefinitionStages.WithNetworkFabricControllerId, + DefinitionStages.WithTerminalServerConfiguration, + DefinitionStages.WithManagementNetworkConfiguration, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFabric create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFabric create(Context context); + } + /** The stage of the NetworkFabric 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 NetworkFabric definition allowing to specify networkFabricSku. */ + interface WithNetworkFabricSku { + /** + * Specifies the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. + * Once the user chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU + * determines whether it is a single / multi rack Network Fabric.. + * + * @param networkFabricSku Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user + * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines + * whether it is a single / multi rack Network Fabric. + * @return the next definition stage. + */ + WithCreate withNetworkFabricSku(String networkFabricSku); + } + /** The stage of the NetworkFabric definition allowing to specify rackCount. */ + interface WithRackCount { + /** + * Specifies the rackCount property: Number of racks associated to Network Fabric.Possible values are from + * 2-8.. + * + * @param rackCount Number of racks associated to Network Fabric.Possible values are from 2-8. + * @return the next definition stage. + */ + WithCreate withRackCount(int rackCount); + } + /** The stage of the NetworkFabric definition allowing to specify serverCountPerRack. */ + interface WithServerCountPerRack { + /** + * Specifies the serverCountPerRack property: Number of servers.Possible values are from 1-16.. + * + * @param serverCountPerRack Number of servers.Possible values are from 1-16. + * @return the next definition stage. + */ + WithCreate withServerCountPerRack(int serverCountPerRack); + } + /** The stage of the NetworkFabric definition allowing to specify ipv4Prefix. */ + interface WithIpv4Prefix { + /** + * Specifies the ipv4Prefix property: IPv4Prefix for Management Network. Default value : 10.1.0.0/19.. + * + * @param ipv4Prefix IPv4Prefix for Management Network. Default value : 10.1.0.0/19. + * @return the next definition stage. + */ + WithCreate withIpv4Prefix(String ipv4Prefix); + } + /** The stage of the NetworkFabric definition allowing to specify ipv6Prefix. */ + interface WithIpv6Prefix { + /** + * Specifies the ipv6Prefix property: IPv6Prefix for Management Network. Default value + * 3FFE:FFFF:0:CD40::/59.. + * + * @param ipv6Prefix IPv6Prefix for Management Network. Default value 3FFE:FFFF:0:CD40::/59. + * @return the next definition stage. + */ + WithCreate withIpv6Prefix(String ipv6Prefix); + } + /** The stage of the NetworkFabric definition allowing to specify fabricAsn. */ + interface WithFabricAsn { + /** + * Specifies the fabricAsn property: ASN of CE devices for CE/PE connectivity.. + * + * @param fabricAsn ASN of CE devices for CE/PE connectivity. + * @return the next definition stage. + */ + WithCreate withFabricAsn(int fabricAsn); + } + /** The stage of the NetworkFabric definition allowing to specify networkFabricControllerId. */ + interface WithNetworkFabricControllerId { + /** + * Specifies the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the + * NetworkFabric belongs.. + * + * @param networkFabricControllerId Azure resource ID for the NetworkFabricController the NetworkFabric + * belongs. + * @return the next definition stage. + */ + WithCreate withNetworkFabricControllerId(String networkFabricControllerId); + } + /** The stage of the NetworkFabric definition allowing to specify terminalServerConfiguration. */ + interface WithTerminalServerConfiguration { + /** + * Specifies the terminalServerConfiguration property: Network and credentials configuration currently + * applied to terminal server.. + * + * @param terminalServerConfiguration Network and credentials configuration currently applied to terminal + * server. + * @return the next definition stage. + */ + WithCreate withTerminalServerConfiguration( + NetworkFabricPropertiesTerminalServerConfiguration terminalServerConfiguration); + } + /** The stage of the NetworkFabric definition allowing to specify managementNetworkConfiguration. */ + interface WithManagementNetworkConfiguration { + /** + * Specifies the managementNetworkConfiguration property: Configuration to be used to setup the management + * network.. + * + * @param managementNetworkConfiguration Configuration to be used to setup the management network. + * @return the next definition stage. + */ + WithCreate withManagementNetworkConfiguration( + NetworkFabricPropertiesManagementNetworkConfiguration managementNetworkConfiguration); + } + /** The stage of the NetworkFabric definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the NetworkFabric resource. + * + * @return the stage of resource update. + */ + NetworkFabric.Update update(); + + /** The template for NetworkFabric update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithTerminalServerConfiguration, UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFabric apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFabric apply(Context context); + } + /** The NetworkFabric update stages. */ + interface UpdateStages { + /** The stage of the NetworkFabric update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags that will replace the existing ones.. + * + * @param tags Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NetworkFabric update allowing to specify terminalServerConfiguration. */ + interface WithTerminalServerConfiguration { + /** + * Specifies the terminalServerConfiguration property: Network and credentials configuration already applied + * to terminal server.. + * + * @param terminalServerConfiguration Network and credentials configuration already applied to terminal + * server. + * @return the next definition stage. + */ + Update withTerminalServerConfiguration( + TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration); + } + /** The stage of the NetworkFabric update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFabric refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFabric refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @throws com.azure.core.management.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 provision(); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @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 provision(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @throws com.azure.core.management.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 deprovision(); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @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 deprovision(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricController.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricController.java new file mode 100644 index 000000000000..761c5c7ac875 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricController.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkFabricController. */ +public interface NetworkFabricController { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the infrastructureServices property: InfrastructureServices IP ranges. + * + * @return the infrastructureServices value. + */ + NetworkFabricControllerPropertiesInfrastructureServices infrastructureServices(); + + /** + * Gets the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + NetworkFabricControllerPropertiesWorkloadServices workloadServices(); + + /** + * Gets the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the networkFabricIds property: The NF-ID will be an input parameter used by the NF to link and get + * associated with the parent NFC Service. + * + * @return the networkFabricIds value. + */ + List networkFabricIds(); + + /** + * Gets the workloadManagementNetwork property: A workload management network is required for all the tenant + * (workload) traffic. This traffic is only dedicated for Tenant workloads which are required to access internet or + * any other MSFT/Public endpoints. + * + * @return the workloadManagementNetwork value. + */ + Boolean workloadManagementNetwork(); + + /** + * Gets the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space. + * + * @return the ipv4AddressSpace value. + */ + String ipv4AddressSpace(); + + /** + * Gets the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space. + * + * @return the ipv6AddressSpace value. + */ + String ipv6AddressSpace(); + + /** + * Gets the operationalState property: The Operational Status would always be NULL. Look only in to the Provisioning + * state for the latest status. + * + * @return the operationalState value. + */ + NetworkFabricControllerOperationalState operationalState(); + + /** + * Gets the provisioningState property: Provides you the latest status of the NFC service, whether it is Accepted, + * updating, Succeeded or Failed. During this process, the states keep changing based on the status of NFC + * provisioning. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @return the infrastructureExpressRouteConnections value. + */ + List infrastructureExpressRouteConnections(); + + /** + * Gets the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @return the workloadExpressRouteConnections value. + */ + List workloadExpressRouteConnections(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner object. + * + * @return the inner object. + */ + NetworkFabricControllerInner innerModel(); + + /** The entirety of the NetworkFabricController definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkFabricController definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkFabricController definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkFabricController 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 NetworkFabricController 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkFabricController 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.WithManagedResourceGroupConfiguration, + DefinitionStages.WithIpv4AddressSpace, + DefinitionStages.WithIpv6AddressSpace, + DefinitionStages.WithInfrastructureExpressRouteConnections, + DefinitionStages.WithWorkloadExpressRouteConnections, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFabricController create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFabricController create(Context context); + } + /** The stage of the NetworkFabricController 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 NetworkFabricController definition allowing to specify managedResourceGroupConfiguration. + */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: Managed Resource Group configuration + * properties.. + * + * @param managedResourceGroupConfiguration Managed Resource Group configuration properties. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration( + NetworkFabricControllerPropertiesManagedResourceGroupConfiguration managedResourceGroupConfiguration); + } + /** The stage of the NetworkFabricController definition allowing to specify ipv4AddressSpace. */ + interface WithIpv4AddressSpace { + /** + * Specifies the ipv4AddressSpace property: IPv4 Network Fabric Controller Address Space.. + * + * @param ipv4AddressSpace IPv4 Network Fabric Controller Address Space. + * @return the next definition stage. + */ + WithCreate withIpv4AddressSpace(String ipv4AddressSpace); + } + /** The stage of the NetworkFabricController definition allowing to specify ipv6AddressSpace. */ + interface WithIpv6AddressSpace { + /** + * Specifies the ipv6AddressSpace property: IPv6 Network Fabric Controller Address Space.. + * + * @param ipv6AddressSpace IPv6 Network Fabric Controller Address Space. + * @return the next definition stage. + */ + WithCreate withIpv6AddressSpace(String ipv6AddressSpace); + } + /** + * The stage of the NetworkFabricController definition allowing to specify + * infrastructureExpressRouteConnections. + */ + interface WithInfrastructureExpressRouteConnections { + /** + * Specifies the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure + * ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated + * for Infrastructure services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for + * Infrastructure services. (This is a Mandatory attribute). + * @return the next definition stage. + */ + WithCreate withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections); + } + /** The stage of the NetworkFabricController definition allowing to specify workloadExpressRouteConnections. */ + interface WithWorkloadExpressRouteConnections { + /** + * Specifies the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload + * services. (This is a Mandatory attribute).. + * + * @param workloadExpressRouteConnections As part of an update, the workload ExpressRoute CircuitID should + * be provided to create and Provision a NFC. This Express route is dedicated for Workload services. + * (This is a Mandatory attribute). + * @return the next definition stage. + */ + WithCreate withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections); + } + /** The stage of the NetworkFabricController definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the NetworkFabricController resource. + * + * @return the stage of resource update. + */ + NetworkFabricController.Update update(); + + /** The template for NetworkFabricController update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithInfrastructureExpressRouteConnections, + UpdateStages.WithWorkloadExpressRouteConnections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFabricController apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFabricController apply(Context context); + } + /** The NetworkFabricController update stages. */ + interface UpdateStages { + /** The stage of the NetworkFabricController update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags that will replace the existing ones.. + * + * @param tags Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** + * The stage of the NetworkFabricController update allowing to specify infrastructureExpressRouteConnections. + */ + interface WithInfrastructureExpressRouteConnections { + /** + * Specifies the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure + * ExpressRoute CircuitID should be provided to create and Provision a NFC. This Express route is dedicated + * for Infrastructure services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for + * Infrastructure services. (This is a Mandatory attribute). + * @return the next definition stage. + */ + Update withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections); + } + /** The stage of the NetworkFabricController update allowing to specify workloadExpressRouteConnections. */ + interface WithWorkloadExpressRouteConnections { + /** + * Specifies the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Workload + * services. (This is a Mandatory attribute).. + * + * @param workloadExpressRouteConnections As part of an update, the workload ExpressRoute CircuitID should + * be provided to create and Provision a NFC. This Express route is dedicated for Workload services. + * (This is a Mandatory attribute). + * @return the next definition stage. + */ + Update withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFabricController refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFabricController refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant 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. + */ + void enableWorkloadManagementNetwork(); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant 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 enableWorkloadManagementNetwork(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant 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. + */ + void disableWorkloadManagementNetwork(); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant 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 disableWorkloadManagementNetwork(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerOperationalState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerOperationalState.java new file mode 100644 index 000000000000..5ab5b8ab0e32 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerOperationalState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Operational state for the resource. */ +public final class NetworkFabricControllerOperationalState + extends ExpandableStringEnum { + /** Static value Configuring for NetworkFabricControllerOperationalState. */ + public static final NetworkFabricControllerOperationalState CONFIGURING = fromString("Configuring"); + + /** Static value Succeeded for NetworkFabricControllerOperationalState. */ + public static final NetworkFabricControllerOperationalState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NetworkFabricControllerOperationalState. */ + public static final NetworkFabricControllerOperationalState FAILED = fromString("Failed"); + + /** + * Creates a new instance of NetworkFabricControllerOperationalState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkFabricControllerOperationalState() { + } + + /** + * Creates or finds a NetworkFabricControllerOperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFabricControllerOperationalState. + */ + @JsonCreator + public static NetworkFabricControllerOperationalState fromString(String name) { + return fromString(name, NetworkFabricControllerOperationalState.class); + } + + /** + * Gets known NetworkFabricControllerOperationalState values. + * + * @return known NetworkFabricControllerOperationalState values. + */ + public static Collection values() { + return values(NetworkFabricControllerOperationalState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPatch.java new file mode 100644 index 000000000000..6b5518a2ee26 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPatch.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerPatchableProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Network Fabric Controller patch parameters + * + *

The NetworkFabricControllerPatch payload definition. + */ +@Fluent +public final class NetworkFabricControllerPatch { + /* + * Network Fabric Controller updatable properties + * + * Network Fabric Controller patch properties. + */ + @JsonProperty(value = "properties") + private NetworkFabricControllerPatchableProperties innerProperties; + + /* + * Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of NetworkFabricControllerPatch class. */ + public NetworkFabricControllerPatch() { + } + + /** + * Get the innerProperties property: Network Fabric Controller updatable properties + * + *

Network Fabric Controller patch properties. + * + * @return the innerProperties value. + */ + private NetworkFabricControllerPatchableProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the NetworkFabricControllerPatch object itself. + */ + public NetworkFabricControllerPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @return the infrastructureExpressRouteConnections value. + */ + public List infrastructureExpressRouteConnections() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureExpressRouteConnections(); + } + + /** + * Set the infrastructureExpressRouteConnections property: As part of an update, the Infrastructure ExpressRoute + * CircuitID should be provided to create and Provision a NFC. This Express route is dedicated for Infrastructure + * services. (This is a Mandatory attribute). + * + * @param infrastructureExpressRouteConnections the infrastructureExpressRouteConnections value to set. + * @return the NetworkFabricControllerPatch object itself. + */ + public NetworkFabricControllerPatch withInfrastructureExpressRouteConnections( + List infrastructureExpressRouteConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerPatchableProperties(); + } + this.innerProperties().withInfrastructureExpressRouteConnections(infrastructureExpressRouteConnections); + return this; + } + + /** + * Get the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @return the workloadExpressRouteConnections value. + */ + public List workloadExpressRouteConnections() { + return this.innerProperties() == null ? null : this.innerProperties().workloadExpressRouteConnections(); + } + + /** + * Set the workloadExpressRouteConnections property: As part of an update, the workload ExpressRoute CircuitID + * should be provided to create and Provision a NFC. This Express route is dedicated for Workload services. (This is + * a Mandatory attribute). + * + * @param workloadExpressRouteConnections the workloadExpressRouteConnections value to set. + * @return the NetworkFabricControllerPatch object itself. + */ + public NetworkFabricControllerPatch withWorkloadExpressRouteConnections( + List workloadExpressRouteConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricControllerPatchableProperties(); + } + this.innerProperties().withWorkloadExpressRouteConnections(workloadExpressRouteConnections); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesInfrastructureServices.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesInfrastructureServices.java new file mode 100644 index 000000000000..38066dcb5615 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesInfrastructureServices.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** InfrastructureServices IP ranges. */ +@Fluent +public final class NetworkFabricControllerPropertiesInfrastructureServices { + /* + * The IPv4 Address space is optional, if the value is not defined at the time of NFC creation, then the default + * value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional attribute. + */ + @JsonProperty(value = "ipv4AddressSpaces") + private List ipv4AddressSpaces; + + /* + * The IPv6 is not supported right now. + */ + @JsonProperty(value = "ipv6AddressSpaces") + private List ipv6AddressSpaces; + + /** Creates an instance of NetworkFabricControllerPropertiesInfrastructureServices class. */ + public NetworkFabricControllerPropertiesInfrastructureServices() { + } + + /** + * Get the ipv4AddressSpaces property: The IPv4 Address space is optional, if the value is not defined at the time + * of NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional + * attribute. + * + * @return the ipv4AddressSpaces value. + */ + public List ipv4AddressSpaces() { + return this.ipv4AddressSpaces; + } + + /** + * Set the ipv4AddressSpaces property: The IPv4 Address space is optional, if the value is not defined at the time + * of NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional + * attribute. + * + * @param ipv4AddressSpaces the ipv4AddressSpaces value to set. + * @return the NetworkFabricControllerPropertiesInfrastructureServices object itself. + */ + public NetworkFabricControllerPropertiesInfrastructureServices withIpv4AddressSpaces( + List ipv4AddressSpaces) { + this.ipv4AddressSpaces = ipv4AddressSpaces; + return this; + } + + /** + * Get the ipv6AddressSpaces property: The IPv6 is not supported right now. + * + * @return the ipv6AddressSpaces value. + */ + public List ipv6AddressSpaces() { + return this.ipv6AddressSpaces; + } + + /** + * Set the ipv6AddressSpaces property: The IPv6 is not supported right now. + * + * @param ipv6AddressSpaces the ipv6AddressSpaces value to set. + * @return the NetworkFabricControllerPropertiesInfrastructureServices object itself. + */ + public NetworkFabricControllerPropertiesInfrastructureServices withIpv6AddressSpaces( + List ipv6AddressSpaces) { + this.ipv6AddressSpaces = ipv6AddressSpaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesManagedResourceGroupConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..97f3e2a4e058 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesManagedResourceGroupConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed Resource Group configuration properties. */ +@Fluent +public final class NetworkFabricControllerPropertiesManagedResourceGroupConfiguration { + /* + * The NFC service will be hosted in a Managed resource group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Managed resource group location. + */ + @JsonProperty(value = "location") + private String location; + + /** Creates an instance of NetworkFabricControllerPropertiesManagedResourceGroupConfiguration class. */ + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration() { + } + + /** + * Get the name property: The NFC service will be hosted in a Managed resource group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The NFC service will be hosted in a Managed resource group. + * + * @param name the name value to set. + * @return the NetworkFabricControllerPropertiesManagedResourceGroupConfiguration object itself. + */ + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: Managed resource group location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Managed resource group location. + * + * @param location the location value to set. + * @return the NetworkFabricControllerPropertiesManagedResourceGroupConfiguration object itself. + */ + public NetworkFabricControllerPropertiesManagedResourceGroupConfiguration withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesWorkloadServices.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesWorkloadServices.java new file mode 100644 index 000000000000..df53202f5637 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPropertiesWorkloadServices.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WorkloadServices IP ranges. */ +@Fluent +public final class NetworkFabricControllerPropertiesWorkloadServices { + /* + * The IPv4 Address space is optional, if the value is defined at the time of NFC creation, then the default value + * 10.0.0.0/19 is considered. The IPV4 address subnet is an optional attribute. + */ + @JsonProperty(value = "ipv4AddressSpaces") + private List ipv4AddressSpaces; + + /* + * The IPv6 is not supported right now. + */ + @JsonProperty(value = "ipv6AddressSpaces") + private List ipv6AddressSpaces; + + /** Creates an instance of NetworkFabricControllerPropertiesWorkloadServices class. */ + public NetworkFabricControllerPropertiesWorkloadServices() { + } + + /** + * Get the ipv4AddressSpaces property: The IPv4 Address space is optional, if the value is defined at the time of + * NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional attribute. + * + * @return the ipv4AddressSpaces value. + */ + public List ipv4AddressSpaces() { + return this.ipv4AddressSpaces; + } + + /** + * Set the ipv4AddressSpaces property: The IPv4 Address space is optional, if the value is defined at the time of + * NFC creation, then the default value 10.0.0.0/19 is considered. The IPV4 address subnet is an optional attribute. + * + * @param ipv4AddressSpaces the ipv4AddressSpaces value to set. + * @return the NetworkFabricControllerPropertiesWorkloadServices object itself. + */ + public NetworkFabricControllerPropertiesWorkloadServices withIpv4AddressSpaces(List ipv4AddressSpaces) { + this.ipv4AddressSpaces = ipv4AddressSpaces; + return this; + } + + /** + * Get the ipv6AddressSpaces property: The IPv6 is not supported right now. + * + * @return the ipv6AddressSpaces value. + */ + public List ipv6AddressSpaces() { + return this.ipv6AddressSpaces; + } + + /** + * Set the ipv6AddressSpaces property: The IPv6 is not supported right now. + * + * @param ipv6AddressSpaces the ipv6AddressSpaces value to set. + * @return the NetworkFabricControllerPropertiesWorkloadServices object itself. + */ + public NetworkFabricControllerPropertiesWorkloadServices withIpv6AddressSpaces(List ipv6AddressSpaces) { + this.ipv6AddressSpaces = ipv6AddressSpaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllers.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllers.java new file mode 100644 index 000000000000..5d02f8c41915 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllers.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkFabricControllers. */ +public interface NetworkFabricControllers { + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @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 NetworkFabricController resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition. + */ + NetworkFabricController getByResourceGroup(String resourceGroupName, String networkFabricControllerName); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricControllerName); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the Network Fabric Controller. + * @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 networkFabricControllerName, Context context); + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFabricControllers by resource group. + * + *

Lists all the NetworkFabricControllers thats available in the 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFabricControllers by subscription. + * + *

Lists all the NetworkFabricControllers by 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 list of NetworkFabricControllers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Enables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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 enableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disableWorkloadManagementNetwork(String resourceGroupName, String networkFabricControllerName); + + /** + * Implements the operation to the underlying resources. + * + *

Disables the workloadManagementNetwork (Tenant Network). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricControllerName Name of the networkFabricController. + * @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 disableWorkloadManagementNetwork( + String resourceGroupName, String networkFabricControllerName, Context context); + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @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 the NetworkFabricController resource definition along with {@link Response}. + */ + NetworkFabricController getById(String id); + + /** + * Gets a Network Fabric Controller. + * + *

Shows the provisioning status of Network Fabric Controller. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricController resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Network Fabric Controller. + * + *

Deletes the Network Fabric Controller resource. + * + * @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 NetworkFabricController resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFabricController definition. + */ + NetworkFabricController.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllersListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllersListResult.java new file mode 100644 index 000000000000..e698c1329a39 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllersListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricControllerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkFabricControllers. */ +@Fluent +public final class NetworkFabricControllersListResult { + /* + * List of NetworkFabricController resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkFabricControllersListResult class. */ + public NetworkFabricControllersListResult() { + } + + /** + * Get the value property: List of NetworkFabricController resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkFabricController resources. + * + * @param value the value value to set. + * @return the NetworkFabricControllersListResult object itself. + */ + public NetworkFabricControllersListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFabricControllersListResult object itself. + */ + public NetworkFabricControllersListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricOperationalState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricOperationalState.java new file mode 100644 index 000000000000..d57ac95df892 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricOperationalState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Operational state for the resource. */ +public final class NetworkFabricOperationalState extends ExpandableStringEnum { + /** Static value Provisioning for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState PROVISIONED = fromString("Provisioned"); + + /** Static value ErrorProvisioning for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState ERROR_PROVISIONING = fromString("ErrorProvisioning"); + + /** Static value Deprovisioning for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState DEPROVISIONING = fromString("Deprovisioning"); + + /** Static value Deprovisioned for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState DEPROVISIONED = fromString("Deprovisioned"); + + /** Static value ErrorDeprovisioning for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState ERROR_DEPROVISIONING = fromString("ErrorDeprovisioning"); + + /** Static value DeferredControl for NetworkFabricOperationalState. */ + public static final NetworkFabricOperationalState DEFERRED_CONTROL = fromString("DeferredControl"); + + /** + * Creates a new instance of NetworkFabricOperationalState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkFabricOperationalState() { + } + + /** + * Creates or finds a NetworkFabricOperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkFabricOperationalState. + */ + @JsonCreator + public static NetworkFabricOperationalState fromString(String name) { + return fromString(name, NetworkFabricOperationalState.class); + } + + /** + * Gets known NetworkFabricOperationalState values. + * + * @return known NetworkFabricOperationalState values. + */ + public static Collection values() { + return values(NetworkFabricOperationalState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchParameters.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchParameters.java new file mode 100644 index 000000000000..7a9565521c8b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchParameters.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricPatchParametersProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The NetworkFabric resource definition. */ +@Fluent +public final class NetworkFabricPatchParameters { + /* + * Network Fabric Patch properties. + */ + @JsonProperty(value = "properties") + private NetworkFabricPatchParametersProperties innerProperties; + + /* + * Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of NetworkFabricPatchParameters class. */ + public NetworkFabricPatchParameters() { + } + + /** + * Get the innerProperties property: Network Fabric Patch properties. + * + * @return the innerProperties value. + */ + private NetworkFabricPatchParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the NetworkFabricPatchParameters object itself. + */ + public NetworkFabricPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @return the terminalServerConfiguration value. + */ + public TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().terminalServerConfiguration(); + } + + /** + * Set the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @param terminalServerConfiguration the terminalServerConfiguration value to set. + * @return the NetworkFabricPatchParameters object itself. + */ + public NetworkFabricPatchParameters withTerminalServerConfiguration( + TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricPatchParametersProperties(); + } + this.innerProperties().withTerminalServerConfiguration(terminalServerConfiguration); + return this; + } + + /** + * Get the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + public List racks() { + return this.innerProperties() == null ? null : this.innerProperties().racks(); + } + + /** + * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + public List l2IsolationDomains() { + return this.innerProperties() == null ? null : this.innerProperties().l2IsolationDomains(); + } + + /** + * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + public List l3IsolationDomains() { + return this.innerProperties() == null ? null : this.innerProperties().l3IsolationDomains(); + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkFabricPatchParameters object itself. + */ + public NetworkFabricPatchParameters withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkFabricPatchParametersProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchableProperties.java new file mode 100644 index 000000000000..4637e94b702e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchableProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Fabric updatable properties. */ +@Immutable +public class NetworkFabricPatchableProperties { + /* + * List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed depends on the Network + * Fabric SKU. + */ + @JsonProperty(value = "racks", access = JsonProperty.Access.WRITE_ONLY) + private List racks; + + /* + * List of L2IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l2IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l2IsolationDomains; + + /* + * List of L3IsolationDomain resource IDs under the Network Fabric. + */ + @JsonProperty(value = "l3IsolationDomains", access = JsonProperty.Access.WRITE_ONLY) + private List l3IsolationDomains; + + /** Creates an instance of NetworkFabricPatchableProperties class. */ + public NetworkFabricPatchableProperties() { + } + + /** + * Get the racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed + * depends on the Network Fabric SKU. + * + * @return the racks value. + */ + public List racks() { + return this.racks; + } + + /** + * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric. + * + * @return the l2IsolationDomains value. + */ + public List l2IsolationDomains() { + return this.l2IsolationDomains; + } + + /** + * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric. + * + * @return the l3IsolationDomains value. + */ + public List l3IsolationDomains() { + return this.l3IsolationDomains; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfiguration.java new file mode 100644 index 000000000000..2ccaebb63ff4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration to be used to setup the management network. */ +@Fluent +public final class NetworkFabricPropertiesManagementNetworkConfiguration { + /* + * Configuration for infrastructure vpn. + */ + @JsonProperty(value = "infrastructureVpnConfiguration", required = true) + private NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration + infrastructureVpnConfiguration; + + /* + * Configuration for workload vpn. + */ + @JsonProperty(value = "workloadVpnConfiguration", required = true) + private NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration workloadVpnConfiguration; + + /** Creates an instance of NetworkFabricPropertiesManagementNetworkConfiguration class. */ + public NetworkFabricPropertiesManagementNetworkConfiguration() { + } + + /** + * Get the infrastructureVpnConfiguration property: Configuration for infrastructure vpn. + * + * @return the infrastructureVpnConfiguration value. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration + infrastructureVpnConfiguration() { + return this.infrastructureVpnConfiguration; + } + + /** + * Set the infrastructureVpnConfiguration property: Configuration for infrastructure vpn. + * + * @param infrastructureVpnConfiguration the infrastructureVpnConfiguration value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfiguration withInfrastructureVpnConfiguration( + NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration + infrastructureVpnConfiguration) { + this.infrastructureVpnConfiguration = infrastructureVpnConfiguration; + return this; + } + + /** + * Get the workloadVpnConfiguration property: Configuration for workload vpn. + * + * @return the workloadVpnConfiguration value. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration workloadVpnConfiguration() { + return this.workloadVpnConfiguration; + } + + /** + * Set the workloadVpnConfiguration property: Configuration for workload vpn. + * + * @param workloadVpnConfiguration the workloadVpnConfiguration value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfiguration withWorkloadVpnConfiguration( + NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration workloadVpnConfiguration) { + this.workloadVpnConfiguration = workloadVpnConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (infrastructureVpnConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property infrastructureVpnConfiguration in model" + + " NetworkFabricPropertiesManagementNetworkConfiguration")); + } else { + infrastructureVpnConfiguration().validate(); + } + if (workloadVpnConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property workloadVpnConfiguration in model" + + " NetworkFabricPropertiesManagementNetworkConfiguration")); + } else { + workloadVpnConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(NetworkFabricPropertiesManagementNetworkConfiguration.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration.java new file mode 100644 index 000000000000..44eafc040bc6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for infrastructure vpn. */ +@Fluent +public final class NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration { + /* + * Indicates configuration state. Example: Enabled | Disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Gets the networkToNetworkInterconnectId of the resource. + */ + @JsonProperty(value = "networkToNetworkInterconnectId", access = JsonProperty.Access.WRITE_ONLY) + private String networkToNetworkInterconnectId; + + /* + * Peering option list. + */ + @JsonProperty(value = "peeringOption") + private PeeringOption peeringOption; + + /* + * option B properties + */ + @JsonProperty(value = "optionBProperties", required = true) + private OptionBPropertiesAutoGenerated optionBProperties; + + /* + * option A properties + */ + @JsonProperty(value = "optionAProperties") + private OptionAPropertiesAutoGenerated optionAProperties; + + /** + * Creates an instance of NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration class. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration() { + } + + /** + * Get the administrativeState property: Indicates configuration state. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. + * + * @return the networkToNetworkInterconnectId value. + */ + public String networkToNetworkInterconnectId() { + return this.networkToNetworkInterconnectId; + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.peeringOption; + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration withPeeringOption( + PeeringOption peeringOption) { + this.peeringOption = peeringOption; + return this; + } + + /** + * Get the optionBProperties property: option B properties. + * + * @return the optionBProperties value. + */ + public OptionBPropertiesAutoGenerated optionBProperties() { + return this.optionBProperties; + } + + /** + * Set the optionBProperties property: option B properties. + * + * @param optionBProperties the optionBProperties value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration withOptionBProperties( + OptionBPropertiesAutoGenerated optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Get the optionAProperties property: option A properties. + * + * @return the optionAProperties value. + */ + public OptionAPropertiesAutoGenerated optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties. + * + * @param optionAProperties the optionAProperties value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration withOptionAProperties( + OptionAPropertiesAutoGenerated optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (optionBProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property optionBProperties in model" + + " NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration")); + } else { + optionBProperties().validate(); + } + if (optionAProperties() != null) { + optionAProperties().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration.java new file mode 100644 index 000000000000..b9a870c94f4d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for workload vpn. */ +@Fluent +public final class NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration { + /* + * Indicates configuration state. Example: enabled | disabled. + */ + @JsonProperty(value = "administrativeState", access = JsonProperty.Access.WRITE_ONLY) + private EnabledDisabledState administrativeState; + + /* + * Peering option list. + */ + @JsonProperty(value = "peeringOption") + private PeeringOption peeringOption; + + /* + * Gets the networkToNetworkInterconnectId of the resource. + */ + @JsonProperty(value = "networkToNetworkInterconnectId", access = JsonProperty.Access.WRITE_ONLY) + private String networkToNetworkInterconnectId; + + /* + * option A properties object + */ + @JsonProperty(value = "optionAProperties") + private OptionAPropertiesAutoGenerated optionAProperties; + + /* + * option B properties object + */ + @JsonProperty(value = "optionBProperties", required = true) + private OptionBPropertiesAutoGenerated optionBProperties; + + /** Creates an instance of NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration class. */ + public NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration() { + } + + /** + * Get the administrativeState property: Indicates configuration state. Example: enabled | disabled. + * + * @return the administrativeState value. + */ + public EnabledDisabledState administrativeState() { + return this.administrativeState; + } + + /** + * Get the peeringOption property: Peering option list. + * + * @return the peeringOption value. + */ + public PeeringOption peeringOption() { + return this.peeringOption; + } + + /** + * Set the peeringOption property: Peering option list. + * + * @param peeringOption the peeringOption value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration withPeeringOption( + PeeringOption peeringOption) { + this.peeringOption = peeringOption; + return this; + } + + /** + * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource. + * + * @return the networkToNetworkInterconnectId value. + */ + public String networkToNetworkInterconnectId() { + return this.networkToNetworkInterconnectId; + } + + /** + * Get the optionAProperties property: option A properties object. + * + * @return the optionAProperties value. + */ + public OptionAPropertiesAutoGenerated optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties object. + * + * @param optionAProperties the optionAProperties value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration withOptionAProperties( + OptionAPropertiesAutoGenerated optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Get the optionBProperties property: option B properties object. + * + * @return the optionBProperties value. + */ + public OptionBPropertiesAutoGenerated optionBProperties() { + return this.optionBProperties; + } + + /** + * Set the optionBProperties property: option B properties object. + * + * @param optionBProperties the optionBProperties value to set. + * @return the NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration object itself. + */ + public NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration withOptionBProperties( + OptionBPropertiesAutoGenerated optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (optionAProperties() != null) { + optionAProperties().validate(); + } + if (optionBProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property optionBProperties in model" + + " NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration")); + } else { + optionBProperties().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesTerminalServerConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesTerminalServerConfiguration.java new file mode 100644 index 000000000000..b9520d329296 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPropertiesTerminalServerConfiguration.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network and credentials configuration currently applied to terminal server. */ +@Fluent +public final class NetworkFabricPropertiesTerminalServerConfiguration extends Layer3IpPrefixPropertiesAutoGenerated { + /* + * ARM Resource ID used for the NetworkDevice. + */ + @JsonProperty(value = "networkDeviceId", access = JsonProperty.Access.WRITE_ONLY) + private String networkDeviceId; + + /* + * Username for the terminal server connection. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password for the terminal server connection. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Serial Number of Terminal server. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of NetworkFabricPropertiesTerminalServerConfiguration class. */ + public NetworkFabricPropertiesTerminalServerConfiguration() { + } + + /** + * Get the networkDeviceId property: ARM Resource ID used for the NetworkDevice. + * + * @return the networkDeviceId value. + */ + public String networkDeviceId() { + return this.networkDeviceId; + } + + /** + * Get the username property: Username for the terminal server connection. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username for the terminal server connection. + * + * @param username the username value to set. + * @return the NetworkFabricPropertiesTerminalServerConfiguration object itself. + */ + public NetworkFabricPropertiesTerminalServerConfiguration withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password for the terminal server connection. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for the terminal server connection. + * + * @param password the password value to set. + * @return the NetworkFabricPropertiesTerminalServerConfiguration object itself. + */ + public NetworkFabricPropertiesTerminalServerConfiguration withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the serialNumber property: Serial Number of Terminal server. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: Serial Number of Terminal server. + * + * @param serialNumber the serialNumber value to set. + * @return the NetworkFabricPropertiesTerminalServerConfiguration object itself. + */ + public NetworkFabricPropertiesTerminalServerConfiguration withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricPropertiesTerminalServerConfiguration withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricPropertiesTerminalServerConfiguration withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricPropertiesTerminalServerConfiguration withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkFabricPropertiesTerminalServerConfiguration withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + super.withSecondaryIpv6Prefix(secondaryIpv6Prefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java new file mode 100644 index 000000000000..26de99f6b502 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; + +/** An immutable client-side representation of NetworkFabricSku. */ +public interface NetworkFabricSku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the typePropertiesType property: Type of Network Fabric Sku. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the maxComputeRacks property: Maximum number of compute racks available for this Network Fabric SKU. + * + * @return the maxComputeRacks value. + */ + Integer maxComputeRacks(); + + /** + * Gets the minSupportedVer property: Minimum supported version. + * + * @return the minSupportedVer value. + */ + String minSupportedVer(); + + /** + * Gets the maxSupportedVer property: Maximum supported version. + * + * @return the maxSupportedVer value. + */ + String maxSupportedVer(); + + /** + * Gets the detailsUri property: The URI gives full details of sku. + * + * @return the detailsUri value. + */ + String detailsUri(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner object. + * + * @return the inner object. + */ + NetworkFabricSkuInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkus.java new file mode 100644 index 000000000000..f52084c806fd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkFabricSkus. */ +public interface NetworkFabricSkus { + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @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 NetworkFabricSku resource definition along with {@link Response}. + */ + Response getWithResponse(String networkFabricSkuName, Context context); + + /** + * Gets a Network Fabric Sku. + * + *

Implements Network Fabric Sku GET method. + * + * @param networkFabricSkuName Name of the Network Fabric Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkFabricSku resource definition. + */ + NetworkFabricSku get(String networkFabricSkuName); + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 NetworkFabricSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFabricSkus by subscription. + * + *

Implements NetworkFabricSkus list by subscription GET method. + * + * @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 list of NetworkFabricSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkusListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkusListResult.java new file mode 100644 index 000000000000..2f4f9377ec39 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkusListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkFabricSkus. */ +@Fluent +public final class NetworkFabricSkusListResult { + /* + * List of NetworkFabricSku resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkFabricSkusListResult class. */ + public NetworkFabricSkusListResult() { + } + + /** + * Get the value property: List of NetworkFabricSku resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkFabricSku resources. + * + * @param value the value value to set. + * @return the NetworkFabricSkusListResult object itself. + */ + public NetworkFabricSkusListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFabricSkusListResult object itself. + */ + public NetworkFabricSkusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java new file mode 100644 index 000000000000..26bf2593d45f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.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.managednetworkfabric.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 NetworkFabrics. */ +public interface NetworkFabrics { + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @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 Fabric resource details along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkFabricName, Context context); + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Fabric resource details. + */ + NetworkFabric getByResourceGroup(String resourceGroupName, String networkFabricName); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricName); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the Network Fabric. + * @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 networkFabricName, Context context); + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFabrics by resource group. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFabrics by subscription. + * + *

List all the Network Fabric resources in the given 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 list of NetworkFabrics as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 provision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Provisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 provision(String resourceGroupName, String networkFabricName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deprovision(String resourceGroupName, String networkFabricName); + + /** + * Implements the operation to the underlying resources. + * + *

Deprovisions the underlying resources in the given Network Fabric instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 deprovision(String resourceGroupName, String networkFabricName, Context context); + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @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 network Fabric resource details along with {@link Response}. + */ + NetworkFabric getById(String id); + + /** + * Gets a Network Fabric. + * + *

Get Network Fabric resource details. + * + * @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 network Fabric resource details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Network Fabric. + * + *

Delete Network Fabric resource. + * + * @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 NetworkFabric resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFabric definition. + */ + NetworkFabric.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricsListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricsListResult.java new file mode 100644 index 000000000000..1de1ed338c9d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricsListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkFabricInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkFabrics. */ +@Fluent +public final class NetworkFabricsListResult { + /* + * List of NetworkFabric resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkFabricsListResult class. */ + public NetworkFabricsListResult() { + } + + /** + * Get the value property: List of NetworkFabric resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkFabric resources. + * + * @param value the value value to set. + * @return the NetworkFabricsListResult object itself. + */ + public NetworkFabricsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFabricsListResult object itself. + */ + public NetworkFabricsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java new file mode 100644 index 000000000000..fc0ed21624b8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.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.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; + +/** An immutable client-side representation of NetworkInterface. */ +public interface NetworkInterface { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the physicalIdentifier property: physicalIdentifier of the network interface. + * + * @return the physicalIdentifier value. + */ + String physicalIdentifier(); + + /** + * Gets the administrativeState property: administrativeState of the network interface. Example: Enabled | Disabled. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the connectedTo property: The arm resource id of the interface or compute server its connected to. + * + * @return the connectedTo value. + */ + String connectedTo(); + + /** + * Gets the interfaceType property: The Interface Type. Example: Management/Data. + * + * @return the interfaceType value. + */ + InterfaceType interfaceType(); + + /** + * Gets the ipv4Address property: ipv4Address. + * + * @return the ipv4Address value. + */ + String ipv4Address(); + + /** + * Gets the ipv6Address property: ipv6Address. + * + * @return the ipv6Address value. + */ + String ipv6Address(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner object. + * + * @return the inner object. + */ + NetworkInterfaceInner innerModel(); + + /** The entirety of the NetworkInterface definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NetworkInterface definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterface definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NetworkInterface definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkDeviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @return the next definition stage. + */ + WithCreate withExistingNetworkDevice(String resourceGroupName, String networkDeviceName); + } + /** + * The stage of the NetworkInterface 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.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterface create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterface create(Context context); + } + /** The stage of the NetworkInterface definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the NetworkInterface resource. + * + * @return the stage of resource update. + */ + NetworkInterface.Update update(); + + /** The template for NetworkInterface update. */ + interface Update extends UpdateStages.WithAnnotation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterface apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterface apply(Context context); + } + /** The NetworkInterface update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterface update allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + Update withAnnotation(String annotation); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterface refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterface refresh(Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface. + */ + InterfaceStatus getStatus(); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @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 running status of the Network Interface. + */ + InterfaceStatus getStatus(Context context); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState(UpdateAdministrativeState body); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param body Request payload. + * @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 updateAdministrativeState(UpdateAdministrativeState body, Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacePatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacePatch.java new file mode 100644 index 000000000000..f12eac310c88 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacePatch.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfacePatchProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NetworkInterfacePatch resource definition. */ +@Fluent +public final class NetworkInterfacePatch { + /* + * Network Interface Patch properties. + */ + @JsonProperty(value = "properties") + private NetworkInterfacePatchProperties innerProperties; + + /** Creates an instance of NetworkInterfacePatch class. */ + public NetworkInterfacePatch() { + } + + /** + * Get the innerProperties property: Network Interface Patch properties. + * + * @return the innerProperties value. + */ + private NetworkInterfacePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + public String annotation() { + return this.innerProperties() == null ? null : this.innerProperties().annotation(); + } + + /** + * Set the annotation property: Switch configuration description. + * + * @param annotation the annotation value to set. + * @return the NetworkInterfacePatch object itself. + */ + public NetworkInterfacePatch withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePatchProperties(); + } + this.innerProperties().withAnnotation(annotation); + 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfaces.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfaces.java new file mode 100644 index 000000000000..2bad8572ac7c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfaces.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.managednetworkfabric.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 NetworkInterfaces. */ +public interface NetworkInterfaces { + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @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 Network Interface resource details along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context); + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details. + */ + NetworkInterface get(String resourceGroupName, String networkDeviceName, String networkInterfaceName); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkDeviceName, String networkInterfaceName); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterfaceName. + * @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 networkDeviceName, String networkInterfaceName, Context context); + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkDeviceName); + + /** + * List all Network Interfaces that are available using an Network Device. + * + *

List all the Network Interface resources in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @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 list of NetworkInterfaces as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkDeviceName, Context context); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the running status of the Network Interface. + */ + InterfaceStatus getStatus(String resourceGroupName, String networkDeviceName, String networkInterfaceName); + + /** + * Implements the operation to the underlying resources. + * + *

Get the running status of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @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 running status of the Network Interface. + */ + InterfaceStatus getStatus( + String resourceGroupName, String networkDeviceName, String networkInterfaceName, Context context); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body); + + /** + * Updates the admin state of the network interface. + * + *

Update the admin state of the Network Interface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkDeviceName Name of the NetworkDevice. + * @param networkInterfaceName Name of the NetworkInterface. + * @param body Request payload. + * @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 updateAdministrativeState( + String resourceGroupName, + String networkDeviceName, + String networkInterfaceName, + UpdateAdministrativeState body, + Context context); + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @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 the Network Interface resource details along with {@link Response}. + */ + NetworkInterface getById(String id); + + /** + * Gets a NetworkInterface. + * + *

Get the Network Interface resource details. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Network Interface resource details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a NetworkInterface. + * + *

Delete the Network Interface resource. + * + * @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 NetworkInterface resource. + * + * @param name resource name. + * @return the first stage of the new NetworkInterface definition. + */ + NetworkInterface.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacesList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacesList.java new file mode 100644 index 000000000000..f5a453341167 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacesList.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkInterfaceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkInterfaces. */ +@Fluent +public final class NetworkInterfacesList { + /* + * List of NetworkInterfaces resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkInterfacesList class. */ + public NetworkInterfacesList() { + } + + /** + * Get the value property: List of NetworkInterfaces resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkInterfaces resources. + * + * @param value the value value to set. + * @return the NetworkInterfacesList object itself. + */ + public NetworkInterfacesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkInterfacesList object itself. + */ + public NetworkInterfacesList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRack.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRack.java new file mode 100644 index 000000000000..a519bf2c76fc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRack.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkRack. */ +public interface NetworkRack { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkRackSku property: Network Rack SKU name. + * + * @return the networkRackSku value. + */ + String networkRackSku(); + + /** + * Gets the networkFabricId property: Network Fabric ARM resource id. + * + * @return the networkFabricId value. + */ + String networkFabricId(); + + /** + * Gets the networkDevices property: List of network device ARM resource ids. + * + * @return the networkDevices value. + */ + List networkDevices(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner object. + * + * @return the inner object. + */ + NetworkRackInner innerModel(); + + /** The entirety of the NetworkRack definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithNetworkRackSku, + DefinitionStages.WithNetworkFabricId, + DefinitionStages.WithCreate { + } + /** The NetworkRack definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkRack definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkRack 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 NetworkRack 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. + */ + WithNetworkRackSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the NetworkRack definition allowing to specify networkRackSku. */ + interface WithNetworkRackSku { + /** + * Specifies the networkRackSku property: Network Rack SKU name.. + * + * @param networkRackSku Network Rack SKU name. + * @return the next definition stage. + */ + WithNetworkFabricId withNetworkRackSku(String networkRackSku); + } + /** The stage of the NetworkRack definition allowing to specify networkFabricId. */ + interface WithNetworkFabricId { + /** + * Specifies the networkFabricId property: Network Fabric ARM resource id.. + * + * @param networkFabricId Network Fabric ARM resource id. + * @return the next definition stage. + */ + WithCreate withNetworkFabricId(String networkFabricId); + } + /** + * The stage of the NetworkRack 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.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkRack create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkRack create(Context context); + } + /** The stage of the NetworkRack 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 NetworkRack definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the NetworkRack resource. + * + * @return the stage of resource update. + */ + NetworkRack.Update update(); + + /** The template for NetworkRack update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkRack apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkRack apply(Context context); + } + /** The NetworkRack update stages. */ + interface UpdateStages { + /** The stage of the NetworkRack 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); + } + /** The stage of the NetworkRack update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + Update withProperties(Object properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkRack refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkRack refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackPatch.java new file mode 100644 index 000000000000..7f166e28ea55 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackPatch.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NetworkRack patch resource definition. */ +@Fluent +public final class NetworkRackPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of NetworkRackPatch class. */ + public NetworkRackPatch() { + } + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the NetworkRackPatch object itself. + */ + public NetworkRackPatch withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * 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 NetworkRackPatch object itself. + */ + public NetworkRackPatch 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackRoleName.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackRoleName.java new file mode 100644 index 000000000000..f4ab9a7f82d9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackRoleName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The role of the Network Rack: Aggregate or Compute. */ +public final class NetworkRackRoleName extends ExpandableStringEnum { + /** Static value ComputeRack for NetworkRackRoleName. */ + public static final NetworkRackRoleName COMPUTE_RACK = fromString("ComputeRack"); + + /** Static value AggregateRack for NetworkRackRoleName. */ + public static final NetworkRackRoleName AGGREGATE_RACK = fromString("AggregateRack"); + + /** + * Creates a new instance of NetworkRackRoleName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkRackRoleName() { + } + + /** + * Creates or finds a NetworkRackRoleName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRackRoleName. + */ + @JsonCreator + public static NetworkRackRoleName fromString(String name) { + return fromString(name, NetworkRackRoleName.class); + } + + /** + * Gets known NetworkRackRoleName values. + * + * @return known NetworkRackRoleName values. + */ + public static Collection values() { + return values(NetworkRackRoleName.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSku.java new file mode 100644 index 000000000000..8742318fe951 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSku.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; +import java.util.List; + +/** An immutable client-side representation of NetworkRackSku. */ +public interface NetworkRackSku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the roleName property: The role of the Network Rack: Aggregate or Compute. + * + * @return the roleName value. + */ + NetworkRackRoleName roleName(); + + /** + * Gets the maximumServerCount property: Maximum number of servers available for this SKU. + * + * @return the maximumServerCount value. + */ + Integer maximumServerCount(); + + /** + * Gets the maximumStorageCount property: Maximum number of storage devices available for this SKU. + * + * @return the maximumStorageCount value. + */ + Integer maximumStorageCount(); + + /** + * Gets the maximumUplinks property: Maximum number of network uplinks available for this SKU. + * + * @return the maximumUplinks value. + */ + Integer maximumUplinks(); + + /** + * Gets the networkDevices property: List of network device properties / role for the Network Rack. + * + * @return the networkDevices value. + */ + List networkDevices(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner object. + * + * @return the inner object. + */ + NetworkRackSkuInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkuPropertiesNetworkDevicesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkuPropertiesNetworkDevicesItem.java new file mode 100644 index 000000000000..791931a0b7c1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkuPropertiesNetworkDevicesItem.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network device properties / role for the Network Rack. */ +@Fluent +public final class NetworkRackSkuPropertiesNetworkDevicesItem { + /* + * Name of the associated Network Device SKU. + */ + @JsonProperty(value = "networkDeviceSkuName") + private String networkDeviceSkuName; + + /* + * Role for the network device. + */ + @JsonProperty(value = "roleType") + private NetworkDeviceRackRoleType roleType; + + /* + * Rack slot for the network device. + */ + @JsonProperty(value = "rackSlot") + private Integer rackSlot; + + /** Creates an instance of NetworkRackSkuPropertiesNetworkDevicesItem class. */ + public NetworkRackSkuPropertiesNetworkDevicesItem() { + } + + /** + * Get the networkDeviceSkuName property: Name of the associated Network Device SKU. + * + * @return the networkDeviceSkuName value. + */ + public String networkDeviceSkuName() { + return this.networkDeviceSkuName; + } + + /** + * Set the networkDeviceSkuName property: Name of the associated Network Device SKU. + * + * @param networkDeviceSkuName the networkDeviceSkuName value to set. + * @return the NetworkRackSkuPropertiesNetworkDevicesItem object itself. + */ + public NetworkRackSkuPropertiesNetworkDevicesItem withNetworkDeviceSkuName(String networkDeviceSkuName) { + this.networkDeviceSkuName = networkDeviceSkuName; + return this; + } + + /** + * Get the roleType property: Role for the network device. + * + * @return the roleType value. + */ + public NetworkDeviceRackRoleType roleType() { + return this.roleType; + } + + /** + * Set the roleType property: Role for the network device. + * + * @param roleType the roleType value to set. + * @return the NetworkRackSkuPropertiesNetworkDevicesItem object itself. + */ + public NetworkRackSkuPropertiesNetworkDevicesItem withRoleType(NetworkDeviceRackRoleType roleType) { + this.roleType = roleType; + return this; + } + + /** + * Get the rackSlot property: Rack slot for the network device. + * + * @return the rackSlot value. + */ + public Integer rackSlot() { + return this.rackSlot; + } + + /** + * Set the rackSlot property: Rack slot for the network device. + * + * @param rackSlot the rackSlot value to set. + * @return the NetworkRackSkuPropertiesNetworkDevicesItem object itself. + */ + public NetworkRackSkuPropertiesNetworkDevicesItem withRackSlot(Integer rackSlot) { + this.rackSlot = rackSlot; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkus.java new file mode 100644 index 000000000000..c7aa58323420 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkRackSkus. */ +public interface NetworkRackSkus { + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @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 Rack SKU resource along with {@link Response}. + */ + Response getWithResponse(String networkRackSkuName, Context context); + + /** + * Gets a Network Rack Sku. + * + *

Get Network Rack SKU resource. + * + * @param networkRackSkuName Name of the Network Rack Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rack SKU resource. + */ + NetworkRackSku get(String networkRackSkuName); + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkRackSkus by subscription. + * + *

List all Network Rack SKUs in the given 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 list of NetworkRackSkus as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkusListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkusListResult.java new file mode 100644 index 000000000000..ed6c22d16464 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkusListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkRackSkus. */ +@Fluent +public final class NetworkRackSkusListResult { + /* + * List of NetworkRackSku resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkRackSkusListResult class. */ + public NetworkRackSkusListResult() { + } + + /** + * Get the value property: List of NetworkRackSku resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkRackSku resources. + * + * @param value the value value to set. + * @return the NetworkRackSkusListResult object itself. + */ + public NetworkRackSkusListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkRackSkusListResult object itself. + */ + public NetworkRackSkusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacks.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacks.java new file mode 100644 index 000000000000..17384714b503 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacks.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkRacks. */ +public interface NetworkRacks { + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @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 Rack resource details along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkRackName, Context context); + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Rack resource details. + */ + NetworkRack getByResourceGroup(String resourceGroupName, String networkRackName); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkRackName); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkRackName Name of the Network Rack. + * @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 networkRackName, Context context); + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkRacks by resource group. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkRacks by subscription. + * + *

List all Network Rack resources in the given 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 list of NetworkRacks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @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 network Rack resource details along with {@link Response}. + */ + NetworkRack getById(String id); + + /** + * Gets a Network Rack. + * + *

Get Network Rack resource details. + * + * @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 network Rack resource details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Network Rack. + * + *

Delete Network Rack resource. + * + * @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 NetworkRack resource. + * + * @param name resource name. + * @return the first stage of the new NetworkRack definition. + */ + NetworkRack.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacksListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacksListResult.java new file mode 100644 index 000000000000..1a717927634a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacksListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkRackInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkRacks. */ +@Fluent +public final class NetworkRacksListResult { + /* + * List of NetworkRack resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkRacksListResult class. */ + public NetworkRacksListResult() { + } + + /** + * Get the value property: List of NetworkRack resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkRack resources. + * + * @param value the value value to set. + * @return the NetworkRacksListResult object itself. + */ + public NetworkRacksListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkRacksListResult object itself. + */ + public NetworkRacksListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java new file mode 100644 index 000000000000..7f996cfc55da --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.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.managednetworkfabric.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; + +/** An immutable client-side representation of NetworkToNetworkInterconnect. */ +public interface NetworkToNetworkInterconnect { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the administrativeState property: Gets the administrativeState of the resource. Example -Enabled/Disabled. + * + * @return the administrativeState value. + */ + EnabledDisabledState administrativeState(); + + /** + * Gets the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: True/False. + * + * @return the isManagementType value. + */ + BooleanEnumProperty isManagementType(); + + /** + * Gets the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. Example: + * True/False. + * + * @return the useOptionB value. + */ + BooleanEnumProperty useOptionB(); + + /** + * Gets the layer2Configuration property: Common properties for Layer2Configuration. + * + * @return the layer2Configuration value. + */ + NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration(); + + /** + * Gets the layer3Configuration property: Common properties for Layer3Configuration. + * + * @return the layer3Configuration value. + */ + Layer3Configuration layer3Configuration(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner + * object. + * + * @return the inner object. + */ + NetworkToNetworkInterconnectInner innerModel(); + + /** The entirety of the NetworkToNetworkInterconnect definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NetworkToNetworkInterconnect definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkToNetworkInterconnect definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NetworkToNetworkInterconnect definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkFabricName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @return the next definition stage. + */ + WithCreate withExistingNetworkFabric(String resourceGroupName, String networkFabricName); + } + /** + * The stage of the NetworkToNetworkInterconnect 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.WithIsManagementType, + DefinitionStages.WithUseOptionB, + DefinitionStages.WithLayer2Configuration, + DefinitionStages.WithLayer3Configuration { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkToNetworkInterconnect create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkToNetworkInterconnect create(Context context); + } + /** The stage of the NetworkToNetworkInterconnect definition allowing to specify isManagementType. */ + interface WithIsManagementType { + /** + * Specifies the isManagementType property: Configuration to use NNI for Infrastructure Management. Example: + * True/False.. + * + * @param isManagementType Configuration to use NNI for Infrastructure Management. Example: True/False. + * @return the next definition stage. + */ + WithCreate withIsManagementType(BooleanEnumProperty isManagementType); + } + /** The stage of the NetworkToNetworkInterconnect definition allowing to specify useOptionB. */ + interface WithUseOptionB { + /** + * Specifies the useOptionB property: Based on this parameter the layer2/layer3 is made as mandatory. + * Example: True/False. + * + * @param useOptionB Based on this parameter the layer2/layer3 is made as mandatory. Example: True/False. + * @return the next definition stage. + */ + WithCreate withUseOptionB(BooleanEnumProperty useOptionB); + } + /** The stage of the NetworkToNetworkInterconnect definition allowing to specify layer2Configuration. */ + interface WithLayer2Configuration { + /** + * Specifies the layer2Configuration property: Common properties for Layer2Configuration.. + * + * @param layer2Configuration Common properties for Layer2Configuration. + * @return the next definition stage. + */ + WithCreate withLayer2Configuration( + NetworkToNetworkInterconnectPropertiesLayer2Configuration layer2Configuration); + } + /** The stage of the NetworkToNetworkInterconnect definition allowing to specify layer3Configuration. */ + interface WithLayer3Configuration { + /** + * Specifies the layer3Configuration property: Common properties for Layer3Configuration.. + * + * @param layer3Configuration Common properties for Layer3Configuration. + * @return the next definition stage. + */ + WithCreate withLayer3Configuration(Layer3Configuration layer3Configuration); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkToNetworkInterconnect refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkToNetworkInterconnect refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPropertiesLayer2Configuration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPropertiesLayer2Configuration.java new file mode 100644 index 000000000000..4873f32f51be --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectPropertiesLayer2Configuration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; + +/** Common properties for Layer2Configuration. */ +@Fluent +public final class NetworkToNetworkInterconnectPropertiesLayer2Configuration extends Layer2Configuration { + /** Creates an instance of NetworkToNetworkInterconnectPropertiesLayer2Configuration class. */ + public NetworkToNetworkInterconnectPropertiesLayer2Configuration() { + } + + /** {@inheritDoc} */ + @Override + public NetworkToNetworkInterconnectPropertiesLayer2Configuration withPortCount(Integer portCount) { + super.withPortCount(portCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkToNetworkInterconnectPropertiesLayer2Configuration withMtu(int mtu) { + super.withMtu(mtu); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnects.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnects.java new file mode 100644 index 000000000000..be9ba5448327 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnects.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 NetworkToNetworkInterconnects. */ +public interface NetworkToNetworkInterconnects { + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @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 NetworkToNetworkInterconnect resource definition along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName, Context context); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition. + */ + NetworkToNetworkInterconnect get( + String resourceGroupName, String networkFabricName, String networkToNetworkInterconnectName); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkFabricName, String networkToNetworkInterconnectName); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @param networkToNetworkInterconnectName Name of the NetworkToNetworkInterconnectName. + * @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 networkFabricName, String networkToNetworkInterconnectName, Context context); + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkFabricName); + + /** + * Executes list operation to display Network To Network Interconnects within a Network Fabric. + * + *

Implements Network To Network Interconnects list by Network Fabric GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkFabricName Name of the NetworkFabric. + * @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 list of NetworkToNetworkInterconnects as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String networkFabricName, Context context); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @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 the NetworkToNetworkInterconnect resource definition along with {@link Response}. + */ + NetworkToNetworkInterconnect getById(String id); + + /** + * Configuration used to setup CE-PE connectivity. + * + *

Implements NetworkToNetworkInterconnects GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetworkToNetworkInterconnect resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a NetworkToNetworkInterconnects. + * + *

Implements NetworkToNetworkInterconnects DELETE method. + * + * @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 NetworkToNetworkInterconnect resource. + * + * @param name resource name. + * @return the first stage of the new NetworkToNetworkInterconnect definition. + */ + NetworkToNetworkInterconnect.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectsList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectsList.java new file mode 100644 index 000000000000..6a3476529d81 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectsList.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.NetworkToNetworkInterconnectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetworkToNetworkInterconnects. */ +@Fluent +public final class NetworkToNetworkInterconnectsList { + /* + * List of NetworkToNetworkInterconnects resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of NetworkToNetworkInterconnectsList class. */ + public NetworkToNetworkInterconnectsList() { + } + + /** + * Get the value property: List of NetworkToNetworkInterconnects resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of NetworkToNetworkInterconnects resources. + * + * @param value the value value to set. + * @return the NetworkToNetworkInterconnectsList object itself. + */ + public NetworkToNetworkInterconnectsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the NetworkToNetworkInterconnectsList object itself. + */ + public NetworkToNetworkInterconnectsList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operation.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operation.java new file mode 100644 index 000000000000..a6a86e4e84d1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operation.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.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationDisplay.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationDisplay.java new file mode 100644 index 000000000000..3c0d1bc7f44c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationListResult.java new file mode 100644 index 000000000000..b2db21c5ef1c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationalStatus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationalStatus.java new file mode 100644 index 000000000000..b8765466429a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationalStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Primary or Secondary power end. */ +public final class OperationalStatus extends ExpandableStringEnum { + /** Static value Booted for OperationalStatus. */ + public static final OperationalStatus BOOTED = fromString("Booted"); + + /** Static value BootPrompt for OperationalStatus. */ + public static final OperationalStatus BOOT_PROMPT = fromString("BootPrompt"); + + /** Static value Ztp for OperationalStatus. */ + public static final OperationalStatus ZTP = fromString("Ztp"); + + /** + * Creates a new instance of OperationalStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationalStatus() { + } + + /** + * Creates or finds a OperationalStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationalStatus. + */ + @JsonCreator + public static OperationalStatus fromString(String name) { + return fromString(name, OperationalStatus.class); + } + + /** + * Gets known OperationalStatus values. + * + * @return known OperationalStatus values. + */ + public static Collection values() { + return values(OperationalStatus.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operations.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operations.java new file mode 100644 index 000000000000..97161d5b573e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operations.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.managednetworkfabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns list of all 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAProperties.java new file mode 100644 index 000000000000..f3238685e3fe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peering optionA properties. */ +@Fluent +public class OptionAProperties extends Layer3IpPrefixProperties { + /* + * MTU to use for option A peering. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * Vlan identifier. Example : 501 + */ + @JsonProperty(value = "vlanId") + private Integer vlanId; + + /* + * Fabric ASN number. Example 65001 + */ + @JsonProperty(value = "fabricASN", access = JsonProperty.Access.WRITE_ONLY) + private Integer fabricAsn; + + /* + * Peer ASN number.Example : 28 + */ + @JsonProperty(value = "peerASN") + private Integer peerAsn; + + /* + * BFD configuration properties + */ + @JsonProperty(value = "bfdConfiguration") + private BfdConfiguration bfdConfiguration; + + /** Creates an instance of OptionAProperties class. */ + public OptionAProperties() { + } + + /** + * Get the mtu property: MTU to use for option A peering. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: MTU to use for option A peering. + * + * @param mtu the mtu value to set. + * @return the OptionAProperties object itself. + */ + public OptionAProperties withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the vlanId property: Vlan identifier. Example : 501. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: Vlan identifier. Example : 501. + * + * @param vlanId the vlanId value to set. + * @return the OptionAProperties object itself. + */ + public OptionAProperties withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the fabricAsn property: Fabric ASN number. Example 65001. + * + * @return the fabricAsn value. + */ + public Integer fabricAsn() { + return this.fabricAsn; + } + + /** + * Get the peerAsn property: Peer ASN number.Example : 28. + * + * @return the peerAsn value. + */ + public Integer peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: Peer ASN number.Example : 28. + * + * @param peerAsn the peerAsn value to set. + * @return the OptionAProperties object itself. + */ + public OptionAProperties withPeerAsn(Integer peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the bfdConfiguration property: BFD configuration properties. + * + * @return the bfdConfiguration value. + */ + public BfdConfiguration bfdConfiguration() { + return this.bfdConfiguration; + } + + /** + * Set the bfdConfiguration property: BFD configuration properties. + * + * @param bfdConfiguration the bfdConfiguration value to set. + * @return the OptionAProperties object itself. + */ + public OptionAProperties withBfdConfiguration(BfdConfiguration bfdConfiguration) { + this.bfdConfiguration = bfdConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAProperties withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAProperties withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAProperties withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAProperties withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + super.withSecondaryIpv6Prefix(secondaryIpv6Prefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (bfdConfiguration() != null) { + bfdConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesAutoGenerated.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesAutoGenerated.java new file mode 100644 index 000000000000..feb41f8a2ff5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesAutoGenerated.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peering optionA properties. */ +@Fluent +public final class OptionAPropertiesAutoGenerated extends Layer3IpPrefixPropertiesAutoGenerated { + /* + * MTU to use for option A peering. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /* + * Vlan Id.Example : 501 + */ + @JsonProperty(value = "vlanId") + private Integer vlanId; + + /* + * Peer ASN number.Example : 28 + */ + @JsonProperty(value = "peerASN") + private Integer peerAsn; + + /* + * BFD Configuration properties. + */ + @JsonProperty(value = "bfdConfiguration") + private OptionAPropertiesBfdConfiguration bfdConfiguration; + + /** Creates an instance of OptionAPropertiesAutoGenerated class. */ + public OptionAPropertiesAutoGenerated() { + } + + /** + * Get the mtu property: MTU to use for option A peering. + * + * @return the mtu value. + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the mtu property: MTU to use for option A peering. + * + * @param mtu the mtu value to set. + * @return the OptionAPropertiesAutoGenerated object itself. + */ + public OptionAPropertiesAutoGenerated withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get the vlanId property: Vlan Id.Example : 501. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.vlanId; + } + + /** + * Set the vlanId property: Vlan Id.Example : 501. + * + * @param vlanId the vlanId value to set. + * @return the OptionAPropertiesAutoGenerated object itself. + */ + public OptionAPropertiesAutoGenerated withVlanId(Integer vlanId) { + this.vlanId = vlanId; + return this; + } + + /** + * Get the peerAsn property: Peer ASN number.Example : 28. + * + * @return the peerAsn value. + */ + public Integer peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: Peer ASN number.Example : 28. + * + * @param peerAsn the peerAsn value to set. + * @return the OptionAPropertiesAutoGenerated object itself. + */ + public OptionAPropertiesAutoGenerated withPeerAsn(Integer peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the bfdConfiguration property: BFD Configuration properties. + * + * @return the bfdConfiguration value. + */ + public OptionAPropertiesBfdConfiguration bfdConfiguration() { + return this.bfdConfiguration; + } + + /** + * Set the bfdConfiguration property: BFD Configuration properties. + * + * @param bfdConfiguration the bfdConfiguration value to set. + * @return the OptionAPropertiesAutoGenerated object itself. + */ + public OptionAPropertiesAutoGenerated withBfdConfiguration(OptionAPropertiesBfdConfiguration bfdConfiguration) { + this.bfdConfiguration = bfdConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAPropertiesAutoGenerated withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAPropertiesAutoGenerated withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAPropertiesAutoGenerated withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public OptionAPropertiesAutoGenerated withSecondaryIpv6Prefix(String secondaryIpv6Prefix) { + super.withSecondaryIpv6Prefix(secondaryIpv6Prefix); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (bfdConfiguration() != null) { + bfdConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesBfdConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesBfdConfiguration.java new file mode 100644 index 000000000000..4a4407211a12 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAPropertiesBfdConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BFD Configuration properties. */ +@Immutable +public final class OptionAPropertiesBfdConfiguration { + /* + * interval in seconds. Example: 300. + */ + @JsonProperty(value = "interval", access = JsonProperty.Access.WRITE_ONLY) + private Integer interval; + + /* + * multiplier. Example: 3. + */ + @JsonProperty(value = "multiplier", access = JsonProperty.Access.WRITE_ONLY) + private Integer multiplier; + + /** Creates an instance of OptionAPropertiesBfdConfiguration class. */ + public OptionAPropertiesBfdConfiguration() { + } + + /** + * Get the interval property: interval in seconds. Example: 300. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Get the multiplier property: multiplier. Example: 3. + * + * @return the multiplier value. + */ + public Integer multiplier() { + return this.multiplier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBProperties.java new file mode 100644 index 000000000000..a4c555d46ac6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Option B configuration. */ +@Fluent +public final class OptionBProperties { + /* + * Route Targets to be applied for incoming routes into CE. + */ + @JsonProperty(value = "importRouteTargets") + private List importRouteTargets; + + /* + * Route Targets to be applied for outgoing routes from CE. + */ + @JsonProperty(value = "exportRouteTargets") + private List exportRouteTargets; + + /** Creates an instance of OptionBProperties class. */ + public OptionBProperties() { + } + + /** + * Get the importRouteTargets property: Route Targets to be applied for incoming routes into CE. + * + * @return the importRouteTargets value. + */ + public List importRouteTargets() { + return this.importRouteTargets; + } + + /** + * Set the importRouteTargets property: Route Targets to be applied for incoming routes into CE. + * + * @param importRouteTargets the importRouteTargets value to set. + * @return the OptionBProperties object itself. + */ + public OptionBProperties withImportRouteTargets(List importRouteTargets) { + this.importRouteTargets = importRouteTargets; + return this; + } + + /** + * Get the exportRouteTargets property: Route Targets to be applied for outgoing routes from CE. + * + * @return the exportRouteTargets value. + */ + public List exportRouteTargets() { + return this.exportRouteTargets; + } + + /** + * Set the exportRouteTargets property: Route Targets to be applied for outgoing routes from CE. + * + * @param exportRouteTargets the exportRouteTargets value to set. + * @return the OptionBProperties object itself. + */ + public OptionBProperties withExportRouteTargets(List exportRouteTargets) { + this.exportRouteTargets = exportRouteTargets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBPropertiesAutoGenerated.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBPropertiesAutoGenerated.java new file mode 100644 index 000000000000..4e97c99372d6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBPropertiesAutoGenerated.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Option B configuration to be used for management vpn. */ +@Fluent +public final class OptionBPropertiesAutoGenerated { + /* + * Route Targets to be applied for incoming routes into CE. + */ + @JsonProperty(value = "importRouteTargets", required = true) + private List importRouteTargets; + + /* + * Route Targets to be applied for outgoing routes from CE. + */ + @JsonProperty(value = "exportRouteTargets", required = true) + private List exportRouteTargets; + + /** Creates an instance of OptionBPropertiesAutoGenerated class. */ + public OptionBPropertiesAutoGenerated() { + } + + /** + * Get the importRouteTargets property: Route Targets to be applied for incoming routes into CE. + * + * @return the importRouteTargets value. + */ + public List importRouteTargets() { + return this.importRouteTargets; + } + + /** + * Set the importRouteTargets property: Route Targets to be applied for incoming routes into CE. + * + * @param importRouteTargets the importRouteTargets value to set. + * @return the OptionBPropertiesAutoGenerated object itself. + */ + public OptionBPropertiesAutoGenerated withImportRouteTargets(List importRouteTargets) { + this.importRouteTargets = importRouteTargets; + return this; + } + + /** + * Get the exportRouteTargets property: Route Targets to be applied for outgoing routes from CE. + * + * @return the exportRouteTargets value. + */ + public List exportRouteTargets() { + return this.exportRouteTargets; + } + + /** + * Set the exportRouteTargets property: Route Targets to be applied for outgoing routes from CE. + * + * @param exportRouteTargets the exportRouteTargets value to set. + * @return the OptionBPropertiesAutoGenerated object itself. + */ + public OptionBPropertiesAutoGenerated withExportRouteTargets(List exportRouteTargets) { + this.exportRouteTargets = exportRouteTargets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (importRouteTargets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property importRouteTargets in model OptionBPropertiesAutoGenerated")); + } + if (exportRouteTargets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property exportRouteTargets in model OptionBPropertiesAutoGenerated")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OptionBPropertiesAutoGenerated.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Origin.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Origin.java new file mode 100644 index 000000000000..bbda7feb92af --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Origin.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PeeringOption.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PeeringOption.java new file mode 100644 index 000000000000..e2933437a097 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PeeringOption.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Peering option list. */ +public final class PeeringOption extends ExpandableStringEnum { + /** Static value OptionA for PeeringOption. */ + public static final PeeringOption OPTIONA = fromString("OptionA"); + + /** Static value OptionB for PeeringOption. */ + public static final PeeringOption OPTIONB = fromString("OptionB"); + + /** + * Creates a new instance of PeeringOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PeeringOption() { + } + + /** + * Creates or finds a PeeringOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding PeeringOption. + */ + @JsonCreator + public static PeeringOption fromString(String name) { + return fromString(name, PeeringOption.class); + } + + /** + * Gets known PeeringOption values. + * + * @return known PeeringOption values. + */ + public static Collection values() { + return values(PeeringOption.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerCycleState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerCycleState.java new file mode 100644 index 000000000000..a81ea89e2b8c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerCycleState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** On or Off power cycle state. */ +public final class PowerCycleState extends ExpandableStringEnum { + /** Static value On for PowerCycleState. */ + public static final PowerCycleState ON = fromString("On"); + + /** Static value Off for PowerCycleState. */ + public static final PowerCycleState OFF = fromString("Off"); + + /** + * Creates a new instance of PowerCycleState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PowerCycleState() { + } + + /** + * Creates or finds a PowerCycleState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PowerCycleState. + */ + @JsonCreator + public static PowerCycleState fromString(String name) { + return fromString(name, PowerCycleState.class); + } + + /** + * Gets known PowerCycleState values. + * + * @return known PowerCycleState values. + */ + public static Collection values() { + return values(PowerCycleState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerEnd.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerEnd.java new file mode 100644 index 000000000000..7f7a77922cba --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerEnd.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Primary or Secondary power end. */ +public final class PowerEnd extends ExpandableStringEnum { + /** Static value Primary for PowerEnd. */ + public static final PowerEnd PRIMARY = fromString("Primary"); + + /** Static value Secondary for PowerEnd. */ + public static final PowerEnd SECONDARY = fromString("Secondary"); + + /** + * Creates a new instance of PowerEnd value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PowerEnd() { + } + + /** + * Creates or finds a PowerEnd from its string representation. + * + * @param name a name to look for. + * @return the corresponding PowerEnd. + */ + @JsonCreator + public static PowerEnd fromString(String name) { + return fromString(name, PowerEnd.class); + } + + /** + * Gets known PowerEnd values. + * + * @return known PowerEnd values. + */ + public static Collection values() { + return values(PowerEnd.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixActionType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixActionType.java new file mode 100644 index 000000000000..3f0aa3f5bd6a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PrefixActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** action. Example: allow | deny. */ +public final class PrefixActionType extends ExpandableStringEnum { + /** Static value allow for PrefixActionType. */ + public static final PrefixActionType ALLOW = fromString("allow"); + + /** Static value deny for PrefixActionType. */ + public static final PrefixActionType DENY = fromString("deny"); + + /** + * Creates a new instance of PrefixActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrefixActionType() { + } + + /** + * Creates or finds a PrefixActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrefixActionType. + */ + @JsonCreator + public static PrefixActionType fromString(String name) { + return fromString(name, PrefixActionType.class); + } + + /** + * Gets known PrefixActionType values. + * + * @return known PrefixActionType values. + */ + public static Collection values() { + return values(PrefixActionType.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ProvisioningState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ProvisioningState.java new file mode 100644 index 000000000000..1ba4b109fdc3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ProvisioningState.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.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * 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); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeConnectedSubnets.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeConnectedSubnets.java new file mode 100644 index 000000000000..e963b12548d3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeConnectedSubnets.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Advertise Connected Subnets. Ex: "True" | "False". */ +public final class RedistributeConnectedSubnets extends ExpandableStringEnum { + /** Static value True for RedistributeConnectedSubnets. */ + public static final RedistributeConnectedSubnets TRUE = fromString("True"); + + /** Static value False for RedistributeConnectedSubnets. */ + public static final RedistributeConnectedSubnets FALSE = fromString("False"); + + /** + * Creates a new instance of RedistributeConnectedSubnets value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedistributeConnectedSubnets() { + } + + /** + * Creates or finds a RedistributeConnectedSubnets from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedistributeConnectedSubnets. + */ + @JsonCreator + public static RedistributeConnectedSubnets fromString(String name) { + return fromString(name, RedistributeConnectedSubnets.class); + } + + /** + * Gets known RedistributeConnectedSubnets values. + * + * @return known RedistributeConnectedSubnets values. + */ + public static Collection values() { + return values(RedistributeConnectedSubnets.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeStaticRoutes.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeStaticRoutes.java new file mode 100644 index 000000000000..5b7847bbb185 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeStaticRoutes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Advertise Static Routes. Ex: "True" | "False". */ +public final class RedistributeStaticRoutes extends ExpandableStringEnum { + /** Static value True for RedistributeStaticRoutes. */ + public static final RedistributeStaticRoutes TRUE = fromString("True"); + + /** Static value False for RedistributeStaticRoutes. */ + public static final RedistributeStaticRoutes FALSE = fromString("False"); + + /** + * Creates a new instance of RedistributeStaticRoutes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedistributeStaticRoutes() { + } + + /** + * Creates or finds a RedistributeStaticRoutes from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedistributeStaticRoutes. + */ + @JsonCreator + public static RedistributeStaticRoutes fromString(String name) { + return fromString(name, RedistributeStaticRoutes.class); + } + + /** + * Gets known RedistributeStaticRoutes values. + * + * @return known RedistributeStaticRoutes values. + */ + public static Collection values() { + return values(RedistributeStaticRoutes.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicies.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicies.java new file mode 100644 index 000000000000..06c5a0737a4a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicies.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.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 RoutePolicies. */ +public interface RoutePolicies { + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String routePolicyName, Context context); + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 RoutePolicy resource definition. + */ + RoutePolicy getByResourceGroup(String resourceGroupName, String routePolicyName); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 deleteByResourceGroup(String resourceGroupName, String routePolicyName); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param routePolicyName Name of the Route 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 routePolicyName, Context context); + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RoutePolicies by resource group. + * + *

Implements RoutePolicies list by resource group GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @throws com.azure.core.management.exception.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 RoutePolicies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RoutePolicies by subscription. + * + *

Implements RoutePolicies list by subscription GET method. + * + * @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 list of RoutePolicies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @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 the RoutePolicy resource definition along with {@link Response}. + */ + RoutePolicy getById(String id); + + /** + * Gets a Route Policy. + * + *

Implements Route Policy GET method. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RoutePolicy resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Route Policy. + * + *

Implements Route Policy DELETE method. + * + * @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 RoutePolicy resource. + * + * @param name resource name. + * @return the first stage of the new RoutePolicy definition. + */ + RoutePolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePoliciesListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePoliciesListResult.java new file mode 100644 index 000000000000..4d1e4e8e3be6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePoliciesListResult.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RoutePolicies. */ +@Fluent +public final class RoutePoliciesListResult { + /* + * List of RoutePolicy resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Url to follow for getting next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoutePoliciesListResult class. */ + public RoutePoliciesListResult() { + } + + /** + * Get the value property: List of RoutePolicy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RoutePolicy resources. + * + * @param value the value value to set. + * @return the RoutePoliciesListResult object itself. + */ + public RoutePoliciesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Url to follow for getting next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Url to follow for getting next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the RoutePoliciesListResult object itself. + */ + public RoutePoliciesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java new file mode 100644 index 000000000000..8b2ab00e6554 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RoutePolicy. */ +public interface RoutePolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: Route Policy description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the conditions property: Route Policy conditions. + * + * @return the conditions value. + */ + List conditions(); + + /** + * Gets the provisioningState property: Gets the provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the annotation property: Switch configuration description. + * + * @return the annotation value. + */ + String annotation(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.RoutePolicyInner object. + * + * @return the inner object. + */ + RoutePolicyInner innerModel(); + + /** The entirety of the RoutePolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RoutePolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the RoutePolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RoutePolicy 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 RoutePolicy 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. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RoutePolicy 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, + DefinitionStages.WithConditions, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoutePolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoutePolicy create(Context context); + } + /** The stage of the RoutePolicy 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 RoutePolicy definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Route Policy description.. + * + * @param description Route Policy description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the RoutePolicy definition allowing to specify conditions. */ + interface WithConditions { + /** + * Specifies the conditions property: Route Policy conditions.. + * + * @param conditions Route Policy conditions. + * @return the next definition stage. + */ + WithCreate withConditions(List conditions); + } + /** The stage of the RoutePolicy definition allowing to specify annotation. */ + interface WithAnnotation { + /** + * Specifies the annotation property: Switch configuration description.. + * + * @param annotation Switch configuration description. + * @return the next definition stage. + */ + WithCreate withAnnotation(String annotation); + } + } + /** + * Begins update for the RoutePolicy resource. + * + * @return the stage of resource update. + */ + RoutePolicy.Update update(); + + /** The template for RoutePolicy update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RoutePolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RoutePolicy apply(Context context); + } + /** The RoutePolicy update stages. */ + interface UpdateStages { + /** The stage of the RoutePolicy 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); + } + /** The stage of the RoutePolicy update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + Update withProperties(Object properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoutePolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoutePolicy refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java new file mode 100644 index 000000000000..5cfc35ca55e1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The RoutePolicy patch resource definition. */ +@Fluent +public final class RoutePolicyPatch { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of RoutePolicyPatch class. */ + public RoutePolicyPatch() { + } + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the RoutePolicyPatch object itself. + */ + public RoutePolicyPatch withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * 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 RoutePolicyPatch object itself. + */ + public RoutePolicyPatch 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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItem.java new file mode 100644 index 000000000000..72230810ba33 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItem.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route Policy condition model. */ +@Fluent +public final class RoutePolicyPropertiesConditionsItem extends AnnotationResource { + /* + * sequenceNumber of the route policy. + */ + @JsonProperty(value = "sequenceNumber") + private Integer sequenceNumber; + + /* + * Route policy match properties. + */ + @JsonProperty(value = "match") + private RoutePolicyPropertiesConditionsItemMatch match; + + /* + * Route policy action properties. + */ + @JsonProperty(value = "action") + private RoutePolicyPropertiesConditionsItemAction action; + + /** Creates an instance of RoutePolicyPropertiesConditionsItem class. */ + public RoutePolicyPropertiesConditionsItem() { + } + + /** + * Get the sequenceNumber property: sequenceNumber of the route policy. + * + * @return the sequenceNumber value. + */ + public Integer sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: sequenceNumber of the route policy. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the RoutePolicyPropertiesConditionsItem object itself. + */ + public RoutePolicyPropertiesConditionsItem withSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the match property: Route policy match properties. + * + * @return the match value. + */ + public RoutePolicyPropertiesConditionsItemMatch match() { + return this.match; + } + + /** + * Set the match property: Route policy match properties. + * + * @param match the match value to set. + * @return the RoutePolicyPropertiesConditionsItem object itself. + */ + public RoutePolicyPropertiesConditionsItem withMatch(RoutePolicyPropertiesConditionsItemMatch match) { + this.match = match; + return this; + } + + /** + * Get the action property: Route policy action properties. + * + * @return the action value. + */ + public RoutePolicyPropertiesConditionsItemAction action() { + return this.action; + } + + /** + * Set the action property: Route policy action properties. + * + * @param action the action value to set. + * @return the RoutePolicyPropertiesConditionsItem object itself. + */ + public RoutePolicyPropertiesConditionsItem withAction(RoutePolicyPropertiesConditionsItemAction action) { + this.action = action; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutePolicyPropertiesConditionsItem withAnnotation(String annotation) { + super.withAnnotation(annotation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (match() != null) { + match().validate(); + } + if (action() != null) { + action().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemAction.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemAction.java new file mode 100644 index 000000000000..13db2865f02b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemAction.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route policy action properties. */ +@Fluent +public final class RoutePolicyPropertiesConditionsItemAction { + /* + * action. Example: accept | deny. + */ + @JsonProperty(value = "action") + private String action; + + /* + * The set property. + */ + @JsonProperty(value = "set") + private Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet set; + + /** Creates an instance of RoutePolicyPropertiesConditionsItemAction class. */ + public RoutePolicyPropertiesConditionsItemAction() { + } + + /** + * Get the action property: action. Example: accept | deny. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: action. Example: accept | deny. + * + * @param action the action value to set. + * @return the RoutePolicyPropertiesConditionsItemAction object itself. + */ + public RoutePolicyPropertiesConditionsItemAction withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the set property: The set property. + * + * @return the set value. + */ + public Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet set() { + return this.set; + } + + /** + * Set the set property: The set property. + * + * @param set the set value to set. + * @return the RoutePolicyPropertiesConditionsItemAction object itself. + */ + public RoutePolicyPropertiesConditionsItemAction withSet( + Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet set) { + this.set = set; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (set() != null) { + set().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemMatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemMatch.java new file mode 100644 index 000000000000..c1da361b1e19 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsItemMatch.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route policy match properties. */ +@Fluent +public final class RoutePolicyPropertiesConditionsItemMatch { + /* + * accessControlListIds. Arm Resource Ids of AccessControlLists. + */ + @JsonProperty(value = "accessControlListIds") + private List accessControlListIds; + + /* + * ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + */ + @JsonProperty(value = "ipCommunityListIds") + private List ipCommunityListIds; + + /* + * ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + */ + @JsonProperty(value = "ipExtendedCommunityListIds") + private List ipExtendedCommunityListIds; + + /* + * ipPrefixListIds. Arm Resource Ids of IpPrefixLists. + */ + @JsonProperty(value = "ipPrefixListIds") + private List ipPrefixListIds; + + /** Creates an instance of RoutePolicyPropertiesConditionsItemMatch class. */ + public RoutePolicyPropertiesConditionsItemMatch() { + } + + /** + * Get the accessControlListIds property: accessControlListIds. Arm Resource Ids of AccessControlLists. + * + * @return the accessControlListIds value. + */ + public List accessControlListIds() { + return this.accessControlListIds; + } + + /** + * Set the accessControlListIds property: accessControlListIds. Arm Resource Ids of AccessControlLists. + * + * @param accessControlListIds the accessControlListIds value to set. + * @return the RoutePolicyPropertiesConditionsItemMatch object itself. + */ + public RoutePolicyPropertiesConditionsItemMatch withAccessControlListIds(List accessControlListIds) { + this.accessControlListIds = accessControlListIds; + return this; + } + + /** + * Get the ipCommunityListIds property: ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @return the ipCommunityListIds value. + */ + public List ipCommunityListIds() { + return this.ipCommunityListIds; + } + + /** + * Set the ipCommunityListIds property: ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @param ipCommunityListIds the ipCommunityListIds value to set. + * @return the RoutePolicyPropertiesConditionsItemMatch object itself. + */ + public RoutePolicyPropertiesConditionsItemMatch withIpCommunityListIds(List ipCommunityListIds) { + this.ipCommunityListIds = ipCommunityListIds; + return this; + } + + /** + * Get the ipExtendedCommunityListIds property: ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @return the ipExtendedCommunityListIds value. + */ + public List ipExtendedCommunityListIds() { + return this.ipExtendedCommunityListIds; + } + + /** + * Set the ipExtendedCommunityListIds property: ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @param ipExtendedCommunityListIds the ipExtendedCommunityListIds value to set. + * @return the RoutePolicyPropertiesConditionsItemMatch object itself. + */ + public RoutePolicyPropertiesConditionsItemMatch withIpExtendedCommunityListIds( + List ipExtendedCommunityListIds) { + this.ipExtendedCommunityListIds = ipExtendedCommunityListIds; + return this; + } + + /** + * Get the ipPrefixListIds property: ipPrefixListIds. Arm Resource Ids of IpPrefixLists. + * + * @return the ipPrefixListIds value. + */ + public List ipPrefixListIds() { + return this.ipPrefixListIds; + } + + /** + * Set the ipPrefixListIds property: ipPrefixListIds. Arm Resource Ids of IpPrefixLists. + * + * @param ipPrefixListIds the ipPrefixListIds value to set. + * @return the RoutePolicyPropertiesConditionsItemMatch object itself. + */ + public RoutePolicyPropertiesConditionsItemMatch withIpPrefixListIds(List ipPrefixListIds) { + this.ipPrefixListIds = ipPrefixListIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsProperties.java new file mode 100644 index 000000000000..b67a44243ede --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPropertiesConditionsProperties.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route policy set manipulations. */ +@Fluent +public final class RoutePolicyPropertiesConditionsProperties { + /* + * ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + */ + @JsonProperty(value = "ipCommunityListIds") + private List ipCommunityListIds; + + /* + * ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + */ + @JsonProperty(value = "ipExtendedCommunityListIds") + private List ipExtendedCommunityListIds; + + /** Creates an instance of RoutePolicyPropertiesConditionsProperties class. */ + public RoutePolicyPropertiesConditionsProperties() { + } + + /** + * Get the ipCommunityListIds property: ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @return the ipCommunityListIds value. + */ + public List ipCommunityListIds() { + return this.ipCommunityListIds; + } + + /** + * Set the ipCommunityListIds property: ipCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @param ipCommunityListIds the ipCommunityListIds value to set. + * @return the RoutePolicyPropertiesConditionsProperties object itself. + */ + public RoutePolicyPropertiesConditionsProperties withIpCommunityListIds(List ipCommunityListIds) { + this.ipCommunityListIds = ipCommunityListIds; + return this; + } + + /** + * Get the ipExtendedCommunityListIds property: ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @return the ipExtendedCommunityListIds value. + */ + public List ipExtendedCommunityListIds() { + return this.ipExtendedCommunityListIds; + } + + /** + * Set the ipExtendedCommunityListIds property: ipExtendedCommunityListIds. Arm Resource Ids of IpCommunityLists. + * + * @param ipExtendedCommunityListIds the ipExtendedCommunityListIds value to set. + * @return the RoutePolicyPropertiesConditionsProperties object itself. + */ + public RoutePolicyPropertiesConditionsProperties withIpExtendedCommunityListIds( + List ipExtendedCommunityListIds) { + this.ipExtendedCommunityListIds = ipExtendedCommunityListIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/State.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/State.java new file mode 100644 index 000000000000..a4edae2e8681 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/State.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** On or Off toggle state. */ +public final class State extends ExpandableStringEnum { + /** Static value On for State. */ + public static final State ON = fromString("On"); + + /** Static value Off for State. */ + public static final State OFF = fromString("Off"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportPackageProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportPackageProperties.java new file mode 100644 index 000000000000..0ed2f753460a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportPackageProperties.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.managednetworkfabric.models; + +import com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner; + +/** An immutable client-side representation of SupportPackageProperties. */ +public interface SupportPackageProperties { + /** + * Gets the supportPackageUrl property: The URL to fetch the generated support package from. + * + * @return the supportPackageUrl value. + */ + String supportPackageUrl(); + + /** + * Gets the inner com.azure.resourcemanager.managednetworkfabric.fluent.models.SupportPackagePropertiesInner object. + * + * @return the inner object. + */ + SupportPackagePropertiesInner innerModel(); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParameters.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParameters.java new file mode 100644 index 000000000000..c38ac4265c24 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParameters.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Terminal server patch parameters. */ +@Fluent +public class TerminalServerPatchParameters { + /* + * Network and credentials configuration already applied to terminal server. + */ + @JsonProperty(value = "terminalServerConfiguration") + private TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration; + + /** Creates an instance of TerminalServerPatchParameters class. */ + public TerminalServerPatchParameters() { + } + + /** + * Get the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @return the terminalServerConfiguration value. + */ + public TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration() { + return this.terminalServerConfiguration; + } + + /** + * Set the terminalServerConfiguration property: Network and credentials configuration already applied to terminal + * server. + * + * @param terminalServerConfiguration the terminalServerConfiguration value to set. + * @return the TerminalServerPatchParameters object itself. + */ + public TerminalServerPatchParameters withTerminalServerConfiguration( + TerminalServerPatchParametersTerminalServerConfiguration terminalServerConfiguration) { + this.terminalServerConfiguration = terminalServerConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminalServerConfiguration() != null) { + terminalServerConfiguration().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParametersTerminalServerConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParametersTerminalServerConfiguration.java new file mode 100644 index 000000000000..6865f2ff206b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParametersTerminalServerConfiguration.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; + +/** Network and credentials configuration already applied to terminal server. */ +@Fluent +public final class TerminalServerPatchParametersTerminalServerConfiguration extends TerminalServerPatchableProperties { + /** Creates an instance of TerminalServerPatchParametersTerminalServerConfiguration class. */ + public TerminalServerPatchParametersTerminalServerConfiguration() { + } + + /** {@inheritDoc} */ + @Override + public TerminalServerPatchParametersTerminalServerConfiguration withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerPatchParametersTerminalServerConfiguration withPassword(String password) { + super.withPassword(password); + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerPatchParametersTerminalServerConfiguration withSerialNumber(String serialNumber) { + super.withSerialNumber(serialNumber); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchableProperties.java new file mode 100644 index 000000000000..7d63156dff4b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchableProperties.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network and credential configuration currently applied on terminal server. */ +@Fluent +public class TerminalServerPatchableProperties { + /* + * Username for the terminal server connection. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password for the terminal server connection. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Serial Number of Terminal server. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of TerminalServerPatchableProperties class. */ + public TerminalServerPatchableProperties() { + } + + /** + * Get the username property: Username for the terminal server connection. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username for the terminal server connection. + * + * @param username the username value to set. + * @return the TerminalServerPatchableProperties object itself. + */ + public TerminalServerPatchableProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password for the terminal server connection. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for the terminal server connection. + * + * @param password the password value to set. + * @return the TerminalServerPatchableProperties object itself. + */ + public TerminalServerPatchableProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the serialNumber property: Serial Number of Terminal server. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: Serial Number of Terminal server. + * + * @param serialNumber the serialNumber value to set. + * @return the TerminalServerPatchableProperties object itself. + */ + public TerminalServerPatchableProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateAdministrativeState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateAdministrativeState.java new file mode 100644 index 000000000000..fbfd2e237166 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateAdministrativeState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update administrative state on list of resources. */ +@Fluent +public final class UpdateAdministrativeState extends EnableDisableOnResources { + /* + * Administrative state. + */ + @JsonProperty(value = "state") + private AdministrativeState state; + + /** Creates an instance of UpdateAdministrativeState class. */ + public UpdateAdministrativeState() { + } + + /** + * Get the state property: Administrative state. + * + * @return the state value. + */ + public AdministrativeState state() { + return this.state; + } + + /** + * Set the state property: Administrative state. + * + * @param state the state value to set. + * @return the UpdateAdministrativeState object itself. + */ + public UpdateAdministrativeState withState(AdministrativeState state) { + this.state = state; + return this; + } + + /** {@inheritDoc} */ + @Override + public UpdateAdministrativeState withResourceIds(List resourceIds) { + super.withResourceIds(resourceIds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdatePowerCycleProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdatePowerCycleProperties.java new file mode 100644 index 000000000000..e5e2dd274199 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdatePowerCycleProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update power cycle input properties. */ +@Fluent +public final class UpdatePowerCycleProperties { + /* + * Primary or Secondary power end. + */ + @JsonProperty(value = "powerEnd", required = true) + private PowerEnd powerEnd; + + /* + * On or Off toggle state. + */ + @JsonProperty(value = "state", required = true) + private State state; + + /** Creates an instance of UpdatePowerCycleProperties class. */ + public UpdatePowerCycleProperties() { + } + + /** + * Get the powerEnd property: Primary or Secondary power end. + * + * @return the powerEnd value. + */ + public PowerEnd powerEnd() { + return this.powerEnd; + } + + /** + * Set the powerEnd property: Primary or Secondary power end. + * + * @param powerEnd the powerEnd value to set. + * @return the UpdatePowerCycleProperties object itself. + */ + public UpdatePowerCycleProperties withPowerEnd(PowerEnd powerEnd) { + this.powerEnd = powerEnd; + return this; + } + + /** + * Get the state property: On or Off toggle state. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: On or Off toggle state. + * + * @param state the state value to set. + * @return the UpdatePowerCycleProperties object itself. + */ + public UpdatePowerCycleProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (powerEnd() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property powerEnd in model UpdatePowerCycleProperties")); + } + if (state() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property state in model UpdatePowerCycleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdatePowerCycleProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersionProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersionProperties.java new file mode 100644 index 000000000000..ed9fed8814a4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersionProperties.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.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Generate support package post action properties. */ +@Fluent +public final class UpdateVersionProperties { + /* + * The supported version defined in network device SKU. + */ + @JsonProperty(value = "skuVersion", required = true) + private String skuVersion; + + /** Creates an instance of UpdateVersionProperties class. */ + public UpdateVersionProperties() { + } + + /** + * Get the skuVersion property: The supported version defined in network device SKU. + * + * @return the skuVersion value. + */ + public String skuVersion() { + return this.skuVersion; + } + + /** + * Set the skuVersion property: The supported version defined in network device SKU. + * + * @param skuVersion the skuVersion value to set. + * @return the UpdateVersionProperties object itself. + */ + public UpdateVersionProperties withSkuVersion(String skuVersion) { + this.skuVersion = skuVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property skuVersion in model UpdateVersionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateVersionProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/package-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/package-info.java new file mode 100644 index 000000000000..cfc08e08f27e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/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 data models for AzureNetworkFabricManagementServiceApi. Self service experience for Azure + * Network Fabric API. + */ +package com.azure.resourcemanager.managednetworkfabric.models; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/package-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/package-info.java new file mode 100644 index 000000000000..9574c0622727 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/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 AzureNetworkFabricManagementServiceApi. Self service experience for Azure Network + * Fabric API. + */ +package com.azure.resourcemanager.managednetworkfabric; diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/module-info.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/module-info.java new file mode 100644 index 000000000000..0d7f66437b38 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/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.managednetworkfabric { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.managednetworkfabric; + exports com.azure.resourcemanager.managednetworkfabric.fluent; + exports com.azure.resourcemanager.managednetworkfabric.fluent.models; + exports com.azure.resourcemanager.managednetworkfabric.models; + + opens com.azure.resourcemanager.managednetworkfabric.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.managednetworkfabric.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java new file mode 100644 index 000000000000..564e3c0cc0b0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ConditionActionType; +import java.util.Arrays; + +/** Samples for AccessControlLists Create. */ +public final class AccessControlListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .define("aclOne") + .withRegion("EastUs") + .withExistingResourceGroup("resourceGroupName") + .withAddressFamily(AddressFamily.IPV4) + .withConditions( + Arrays + .asList( + new AccessControlListPropertiesConditionsItem() + .withSequenceNumber(3) + .withAction(ConditionActionType.ALLOW) + .withDestinationAddress("1.1.1.1") + .withDestinationPort("21") + .withSourceAddress("2.2.2.2") + .withSourcePort("65000") + .withProtocol(6))) + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsDeleteSamples.java new file mode 100644 index 000000000000..f0817efe3326 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for AccessControlLists Delete. */ +public final class AccessControlListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .deleteByResourceGroupWithResponse("subscriptionId", "aclOne", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9472d4f3c2a7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for AccessControlLists GetByResourceGroup. */ +public final class AccessControlListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .accessControlLists() + .getByResourceGroupWithResponse("resourceGroupName", "aclOne", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupSamples.java new file mode 100644 index 000000000000..983bbccfb743 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for AccessControlLists ListByResourceGroup. */ +public final class AccessControlListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.accessControlLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListSamples.java new file mode 100644 index 000000000000..1ac827a61f3a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for AccessControlLists List. */ +public final class AccessControlListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.accessControlLists().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java new file mode 100644 index 000000000000..522530b5d178 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlList; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatchPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.AddressFamily; +import com.azure.resourcemanager.managednetworkfabric.models.ConditionActionType; +import java.util.Arrays; + +/** Samples for AccessControlLists Update. */ +public final class AccessControlListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/AccessControlLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: AccessControlLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void accessControlListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + AccessControlList resource = + manager + .accessControlLists() + .getByResourceGroupWithResponse("resourceGroupName", "aclOne", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withAddressFamily(AddressFamily.IPV4) + .withConditionsForUpdate( + Arrays + .asList( + new AccessControlListPatchPropertiesConditionsItem() + .withSequenceNumber(4) + .withAction(ConditionActionType.ALLOW) + .withDestinationAddress("1.1.1.2") + .withDestinationPort("21") + .withSourceAddress("2.2.2.3") + .withSourcePort("65000") + .withProtocol(6))) + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearArpEntriesSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearArpEntriesSamples.java new file mode 100644 index 000000000000..eb2ed0af2b5b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearArpEntriesSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for ExternalNetworks ClearArpEntries. */ +public final class ExternalNetworksClearArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_clearArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksClearArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .clearArpEntries( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearIpv6NeighborsSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearIpv6NeighborsSamples.java new file mode 100644 index 000000000000..aae8bb0e5f76 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearIpv6NeighborsSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for ExternalNetworks ClearIpv6Neighbors. */ +public final class ExternalNetworksClearIpv6NeighborsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_clearIpv6Neighbors_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksClearIpv6NeighborsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .clearIpv6Neighbors( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateSamples.java new file mode 100644 index 000000000000..3ef1c0ea5d4b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for ExternalNetworks Create. */ +public final class ExternalNetworksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .define("example-externalnetwork") + .withExistingL3IsolationDomain("resourceGroupName", "example-l3domain") + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBProperties() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new ExternalNetworkPropertiesOptionAProperties() + .withPrimaryIpv4Prefix("10.1.1.0/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("10.1.1.4/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withMtu(1500) + .withVlanId(1001) + .withPeerAsn(65047) + .withBfdConfiguration(new BfdConfiguration())) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksDeleteSamples.java new file mode 100644 index 000000000000..c536ffb93700 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for ExternalNetworks Delete. */ +public final class ExternalNetworksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .delete( + "resourceGroupName", "example-l3domain", "example-externalnetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetSamples.java new file mode 100644 index 000000000000..d687f99260fc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetSamples.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.managednetworkfabric.generated; + +/** Samples for ExternalNetworks Get. */ +public final class ExternalNetworksGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .getWithResponse( + "resourceGroupName", "example-l3domain", "example-externalnetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListSamples.java new file mode 100644 index 000000000000..ebe28f329a52 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for ExternalNetworks List. */ +public final class ExternalNetworksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_List_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.externalNetworks().list("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateSamples.java new file mode 100644 index 000000000000..10739a10e66f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateAdministrativeState. */ +public final class ExternalNetworksUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java new file mode 100644 index 000000000000..9414d80bc538 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateBfdForBgpAdministrativeState. */ +public final class ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateBfdForBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateBfdForBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBgpAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBgpAdministrativeStateSamples.java new file mode 100644 index 000000000000..2d0f11c1082b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBgpAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for ExternalNetworks UpdateBgpAdministrativeState. */ +public final class ExternalNetworksUpdateBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .externalNetworks() + .updateBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateSamples.java new file mode 100644 index 000000000000..5de7c1130261 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for ExternalNetworks Update. */ +public final class ExternalNetworksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ExternalNetworks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ExternalNetworks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void externalNetworksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + ExternalNetwork resource = + manager + .externalNetworks() + .getWithResponse( + "resourceGroupName", + "example-l3domain", + "example-externalnetwork", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBProperties() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new OptionAProperties() + .withPrimaryIpv4Prefix("10.1.1.0/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("10.1.1.4/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withMtu(1500) + .withVlanId(1001) + .withPeerAsn(65047) + .withBfdConfiguration(new BfdConfiguration())) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName") + .withAnnotation("Lab 1") + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearArpEntriesSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearArpEntriesSamples.java new file mode 100644 index 000000000000..d100d00c57af --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearArpEntriesSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for InternalNetworks ClearArpEntries. */ +public final class InternalNetworksClearArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_clearArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksClearArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .clearArpEntries( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearIpv6NeighborsSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearIpv6NeighborsSamples.java new file mode 100644 index 000000000000..e60dc997c87b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearIpv6NeighborsSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for InternalNetworks ClearIpv6Neighbors. */ +public final class InternalNetworksClearIpv6NeighborsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_clearIpv6Neighbors_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_clearIpv6Neighbors_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksClearIpv6NeighborsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .clearIpv6Neighbors( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateSamples.java new file mode 100644 index 000000000000..da741f167ca2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateSamples.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem; +import java.util.Arrays; + +/** Samples for InternalNetworks Create. */ +public final class InternalNetworksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .define("example-internalnetwork") + .withExistingL3IsolationDomain("resourceGroupName", "example-l3domain") + .withVlanId(501) + .withMtu(1500) + .withConnectedIPv4Subnets( + Arrays + .asList(new InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets( + Arrays + .asList( + new InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new InternalNetworkPatchablePropertiesStaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new InternalNetworkPatchablePropertiesBgpConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) + .withAllowAS(1) + .withAllowASOverride(AllowASOverride.ENABLE) + .withPeerAsn(6) + .withIpv4ListenRangePrefixes(Arrays.asList("10.1.0.0/25")) + .withIpv6ListenRangePrefixes(Arrays.asList("2fff::/66")) + .withIpv4NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem() + .withAddress("10.1.0.0"))) + .withIpv6NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem() + .withAddress("2fff::")))) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksDeleteSamples.java new file mode 100644 index 000000000000..7108d180dab7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for InternalNetworks Delete. */ +public final class InternalNetworksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .delete( + "resourceGroupName", "example-l3domain", "example-internalnetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetSamples.java new file mode 100644 index 000000000000..2ead7b2711a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetSamples.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.managednetworkfabric.generated; + +/** Samples for InternalNetworks Get. */ +public final class InternalNetworksGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .getWithResponse( + "resourceGroupName", "example-l3domain", "example-internalnetwork", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListSamples.java new file mode 100644 index 000000000000..5b6e7b40ca47 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for InternalNetworks List. */ +public final class InternalNetworksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_List_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.internalNetworks().list("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateSamples.java new file mode 100644 index 000000000000..fa9863c9c53e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateAdministrativeState. */ +public final class InternalNetworksUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java new file mode 100644 index 000000000000..99845fbf504f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForBgpAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBfdForBgpAdministrativeState. */ +public final class InternalNetworksUpdateBfdForBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBfdForBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBfdForBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBfdForBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples.java new file mode 100644 index 000000000000..b3bd226ef98c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBfdForStaticRouteAdministrativeState. */ +public final class InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBfdForStaticRouteAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBfdForStaticRouteAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBfdForStaticRouteAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBfdForStaticRouteAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateSamples.java new file mode 100644 index 000000000000..cc0c71bdbe7f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for InternalNetworks UpdateBgpAdministrativeState. */ +public final class InternalNetworksUpdateBgpAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_updateBgpAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateBgpAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .internalNetworks() + .updateBgpAdministrativeState( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/example-l3domain/internalNetworks/example-internalnetwork")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateSamples.java new file mode 100644 index 000000000000..b3d7b3ae4485 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateSamples.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem; +import java.util.Arrays; + +/** Samples for InternalNetworks Update. */ +public final class InternalNetworksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/InternalNetworks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: InternalNetworks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void internalNetworksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + InternalNetwork resource = + manager + .internalNetworks() + .getWithResponse( + "resourceGroupName", + "example-l3domain", + "example-internalnetwork", + com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withMtu(1500) + .withConnectedIPv4Subnets( + Arrays + .asList(new InternalNetworkPatchablePropertiesConnectedIPv4SubnetsItem().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets( + Arrays + .asList( + new InternalNetworkPatchablePropertiesConnectedIPv6SubnetsItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new InternalNetworkPatchablePropertiesStaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv4RoutesItem() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new InternalNetworkPatchablePropertiesStaticRouteConfigurationIpv6RoutesItem() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new InternalNetworkPatchablePropertiesBgpConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withDefaultRouteOriginate(BooleanEnumProperty.TRUE) + .withAllowAS(1) + .withAllowASOverride(AllowASOverride.ENABLE) + .withPeerAsn(6) + .withIpv4ListenRangePrefixes(Arrays.asList("10.1.0.0/25")) + .withIpv6ListenRangePrefixes(Arrays.asList("2fff::/66")) + .withIpv4NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv4NeighborAddressItem() + .withAddress("10.1.0.0"))) + .withIpv6NeighborAddress( + Arrays + .asList( + new InternalNetworkPatchablePropertiesBgpConfigurationIpv6NeighborAddressItem() + .withAddress("2fff::")))) + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsCreateSamples.java new file mode 100644 index 000000000000..9c139b202024 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsCreateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdvertiseBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionType; +import com.azure.resourcemanager.managednetworkfabric.models.ExportBoolean; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesCommunityMembersItem; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityListPropertiesEvpnEsImportRouteTargetsItem; +import com.azure.resourcemanager.managednetworkfabric.models.LocalASBoolean; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunityLists Create. */ +public final class IpCommunityListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .define("aaaaa") + .withRegion("EastUS") + .withExistingResourceGroup("rgIpCommunityLists") + .withTags(mapOf("key2814", "")) + .withAction(CommunityActionType.ALLOW) + .withLocalAS(LocalASBoolean.TRUE) + .withAdvertise(AdvertiseBoolean.TRUE) + .withExport(ExportBoolean.TRUE) + .withCommunityMembers( + Arrays + .asList( + new IpCommunityListPropertiesCommunityMembersItem() + .withAnnotation("app2") + .withCommunityMember("1234:5678"))) + .withEvpnEsImportRouteTargets( + Arrays + .asList( + new IpCommunityListPropertiesEvpnEsImportRouteTargetsItem() + .withAnnotation("app1") + .withEvpnEsImportRouteTarget("1.1.1"))) + .withAnnotation("aaaa") + .create(); + } + + @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsDeleteSamples.java new file mode 100644 index 000000000000..5845e592ca2c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for IpCommunityLists Delete. */ +public final class IpCommunityListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .deleteByResourceGroupWithResponse( + "resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..78c8fd287c96 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for IpCommunityLists GetByResourceGroup. */ +public final class IpCommunityListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunityLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListByResourceGroupSamples.java new file mode 100644 index 000000000000..bd0a3dc33e80 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for IpCommunityLists ListByResourceGroup. */ +public final class IpCommunityListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunityLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListSamples.java new file mode 100644 index 000000000000..6b8cb97a55cb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for IpCommunityLists List. */ +public final class IpCommunityListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunityLists().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsUpdateSamples.java new file mode 100644 index 000000000000..7e3536b4e00e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunityListsUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityList; + +/** Samples for IpCommunityLists Update. */ +public final class IpCommunityListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunityLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: IpCommunityLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunityListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpCommunityList resource = + manager + .ipCommunityLists() + .getByResourceGroupWithResponse( + "resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsCreateSamples.java new file mode 100644 index 000000000000..df69e0d4ae0d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsCreateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.PrefixActionType; + +/** Samples for IpPrefixLists Create. */ +public final class IpPrefixListsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Create_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Create_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsCreateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .define("IpPrefixList1") + .withRegion("EastUS") + .withExistingResourceGroup("resourceGroupName") + .withAction(PrefixActionType.ALLOW) + .withSequenceNumber(19) + .withNetworkAddress("1.1.1.0/24") + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsDeleteSamples.java new file mode 100644 index 000000000000..7d172e8fd401 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for IpPrefixLists Delete. */ +public final class IpPrefixListsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsDeleteMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .deleteByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..2e5a6b3127f2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for IpPrefixLists GetByResourceGroup. */ +public final class IpPrefixListsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Get_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Get_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsGetMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e99934ed4b92 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for IpPrefixLists ListByResourceGroup. */ +public final class IpPrefixListsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixLists().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListSamples.java new file mode 100644 index 000000000000..048fd661905f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for IpPrefixLists List. */ +public final class IpPrefixListsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixLists().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsUpdateSamples.java new file mode 100644 index 000000000000..e7486cd4f799 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixListsUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixList; + +/** Samples for IpPrefixLists Update. */ +public final class IpPrefixListsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixLists_Update_MinimumSet_Gen.json + */ + /** + * Sample code: IpPrefixLists_Update_MinimumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixListsUpdateMinimumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpPrefixList resource = + manager + .ipPrefixLists() + .getByResourceGroupWithResponse("resourceGroupName", "IpPrefixList1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearArpTableSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearArpTableSamples.java new file mode 100644 index 000000000000..5343817dff8e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearArpTableSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L2IsolationDomains ClearArpTable. */ +public final class L2IsolationDomainsClearArpTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearArpTable_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_clearArpTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsClearArpTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .clearArpTable( + "resourceGroupName", + "example-l2domain", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearNeighborTableSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearNeighborTableSamples.java new file mode 100644 index 000000000000..4ed8a7b28baa --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearNeighborTableSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L2IsolationDomains ClearNeighborTable. */ +public final class L2IsolationDomainsClearNeighborTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_clearNeighborTable_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_clearNeighborTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsClearNeighborTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .clearNeighborTable( + "rgL2IsolationDomains", + "oz", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java new file mode 100644 index 000000000000..237dc98d5e32 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains Create. */ +public final class L2IsolationDomainsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Create_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .define("example-l2domain") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricId( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName") + .withVlanId(501) + .withMtu(1500) + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsDeleteSamples.java new file mode 100644 index 000000000000..9c7952eb4d65 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains Delete. */ +public final class L2IsolationDomainsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().delete("resourceGroupName", "example-l2domain", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetArpEntriesSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetArpEntriesSamples.java new file mode 100644 index 000000000000..842389c80c8e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetArpEntriesSamples.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.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains GetArpEntries. */ +public final class L2IsolationDomainsGetArpEntriesSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_getArpEntries_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_getArpEntries_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsGetArpEntriesMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .getArpEntries("resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3fe209c1c2f1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains GetByResourceGroup. */ +public final class L2IsolationDomainsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Get_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f6c066785556 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains ListByResourceGroup. */ +public final class L2IsolationDomainsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListSamples.java new file mode 100644 index 000000000000..c8d816937800 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L2IsolationDomains List. */ +public final class L2IsolationDomainsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l2IsolationDomains().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateSamples.java new file mode 100644 index 000000000000..8c98993af21d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L2IsolationDomains UpdateAdministrativeState. */ +public final class L2IsolationDomainsUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l2IsolationDomains() + .updateAdministrativeState( + "resourceGroupName", + "l2IsolationDomainName", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java new file mode 100644 index 000000000000..cd7fc4fb0b3b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.L2IsolationDomain; + +/** Samples for L2IsolationDomains Update. */ +public final class L2IsolationDomainsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L2IsolationDomains_Update_MaximumSet_Gen.json + */ + /** + * Sample code: L2IsolationDomains_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l2IsolationDomainsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + L2IsolationDomain resource = + manager + .l2IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "l2IsolationDomainName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withMtu(9000).apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearArpTableSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearArpTableSamples.java new file mode 100644 index 000000000000..2dc4e38b3d41 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearArpTableSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L3IsolationDomains ClearArpTable. */ +public final class L3IsolationDomainsClearArpTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearArpTable_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_clearArpTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsClearArpTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .clearArpTable( + "resourceGroupName", + "l3IsolationDomainName", + new EnableDisableOnResources() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearNeighborTableSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearNeighborTableSamples.java new file mode 100644 index 000000000000..8a2cde8bf5eb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearNeighborTableSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources; +import java.util.Arrays; + +/** Samples for L3IsolationDomains ClearNeighborTable. */ +public final class L3IsolationDomainsClearNeighborTableSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_clearNeighborTable_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_clearNeighborTable_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsClearNeighborTableMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .clearNeighborTable( + "resourceGroupName", + "example-l3domain", + new EnableDisableOnResources().withResourceIds(Arrays.asList("wnaxqikneofcni")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java new file mode 100644 index 000000000000..1237edfad527 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import java.util.Arrays; + +/** Samples for L3IsolationDomains Create. */ +public final class L3IsolationDomainsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Create_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .define("example-l3domain") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricId( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName") + .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) + .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) + .withAggregateRouteConfiguration( + new L3IsolationDomainPatchPropertiesAggregateRouteConfiguration() + .withIpv4Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem() + .withPrefix("10.0.0.0/24"))) + .withIpv6Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem() + .withPrefix("10.0.0.1")))) + .withDescription("creating L3 isolation domain") + .withConnectedSubnetRoutePolicy( + new L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy() + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2")) + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsDeleteSamples.java new file mode 100644 index 000000000000..f325b0ff0531 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L3IsolationDomains Delete. */ +public final class L3IsolationDomainsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().delete("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e8652fd580c1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for L3IsolationDomains GetByResourceGroup. */ +public final class L3IsolationDomainsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Get_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .getByResourceGroupWithResponse("resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupSamples.java new file mode 100644 index 000000000000..8d2e00411a3a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L3IsolationDomains ListByResourceGroup. */ +public final class L3IsolationDomainsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListSamples.java new file mode 100644 index 000000000000..9f431127ad2c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for L3IsolationDomains List. */ +public final class L3IsolationDomainsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.l3IsolationDomains().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateSamples.java new file mode 100644 index 000000000000..ba97732901ee --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L3IsolationDomains UpdateAdministrativeState. */ +public final class L3IsolationDomainsUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .updateAdministrativeState( + "resourceGroupName", + "example-l3domain", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateOptionBAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateOptionBAdministrativeStateSamples.java new file mode 100644 index 000000000000..5e0ec0118114 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateOptionBAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; +import java.util.Arrays; + +/** Samples for L3IsolationDomains UpdateOptionBAdministrativeState. */ +public final class L3IsolationDomainsUpdateOptionBAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_updateOptionBAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_updateOptionBAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateOptionBAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .l3IsolationDomains() + .updateOptionBAdministrativeState( + "resourceGroupName", + "example-l3domain", + new UpdateAdministrativeState() + .withResourceIds( + Arrays + .asList( + "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain")) + .withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java new file mode 100644 index 000000000000..b431af1ab9f1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets; +import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes; +import java.util.Arrays; + +/** Samples for L3IsolationDomains Update. */ +public final class L3IsolationDomainsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Update_MaximumSet_Gen.json + */ + /** + * Sample code: L3IsolationDomains_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void l3IsolationDomainsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + L3IsolationDomain resource = + manager + .l3IsolationDomains() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-l3domain", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE) + .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE) + .withAggregateRouteConfiguration( + new L3IsolationDomainPatchPropertiesAggregateRouteConfiguration() + .withIpv4Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv4RoutesItem() + .withPrefix("10.0.0.0/24"))) + .withIpv6Routes( + Arrays + .asList( + new L3IsolationDomainPatchPropertiesAggregateRouteConfigurationIpv6RoutesItem() + .withPrefix("3FFE:FFFF:0:CD30::a0/29")))) + .withDescription("creating L3 isolation domain") + .withConnectedSubnetRoutePolicy( + new L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy() + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName")) + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetSamples.java new file mode 100644 index 000000000000..af8ae5c75839 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDeviceSkus Get. */ +public final class NetworkDeviceSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDeviceSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDeviceSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDeviceSkus().getWithResponse("DefaultSku", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListSamples.java new file mode 100644 index 000000000000..ce32c99741a7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDeviceSkus List. */ +public final class NetworkDeviceSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDeviceSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDeviceSkus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java new file mode 100644 index 000000000000..d726830f70f8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleTypes; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkDevices Create. */ +public final class NetworkDevicesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .define("networkDeviceName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("keyID", "keyValue")) + .withNetworkDeviceSku("DefaultSku") + .withNetworkDeviceRole(NetworkDeviceRoleTypes.CE) + .withHostname("networkDeviceName") + .withSerialNumber("Arista;DCS-7280PR3-24;12.05;JPE21330382") + .withAnnotation("null") + .create(); + } + + @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesDeleteSamples.java new file mode 100644 index 000000000000..725fe6b50bca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDevices Delete. */ +public final class NetworkDevicesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().delete("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGenerateSupportPackageSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGenerateSupportPackageSamples.java new file mode 100644 index 000000000000..4a4b2c45bdb6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGenerateSupportPackageSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkDevices GenerateSupportPackage. */ +public final class NetworkDevicesGenerateSupportPackageSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_generateSupportPackage_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_generateSupportPackage_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGenerateSupportPackageMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .generateSupportPackage("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6b4223cecc59 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkDevices GetByResourceGroup. */ +public final class NetworkDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getByResourceGroupWithResponse("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetDynamicInterfaceMapsSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetDynamicInterfaceMapsSamples.java new file mode 100644 index 000000000000..fb47e74830fb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetDynamicInterfaceMapsSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkDevices GetDynamicInterfaceMaps. */ +public final class NetworkDevicesGetDynamicInterfaceMapsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getDynamicInterfaceMaps_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getDynamicInterfaceMaps_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetDynamicInterfaceMapsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getDynamicInterfaceMaps("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStaticInterfaceMapsSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStaticInterfaceMapsSamples.java new file mode 100644 index 000000000000..6f60e11b2552 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStaticInterfaceMapsSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkDevices GetStaticInterfaceMaps. */ +public final class NetworkDevicesGetStaticInterfaceMapsSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStaticInterfaceMaps_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getStaticInterfaceMaps_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetStaticInterfaceMapsMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .getStaticInterfaceMaps("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStatusSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStatusSamples.java new file mode 100644 index 000000000000..61a79b5b6a92 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStatusSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDevices GetStatus. */ +public final class NetworkDevicesGetStatusSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_getStatus_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_getStatus_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesGetStatusMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().getStatus("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..2d62dfcf9eed --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDevices ListByResourceGroup. */ +public final class NetworkDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListSamples.java new file mode 100644 index 000000000000..e7ec69777b42 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDevices List. */ +public final class NetworkDevicesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootSamples.java new file mode 100644 index 000000000000..61c86d7576d8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkDevices Reboot. */ +public final class NetworkDevicesRebootSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_reboot_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_reboot_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesRebootMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkDevices().reboot("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRestoreConfigSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRestoreConfigSamples.java new file mode 100644 index 000000000000..9883f81429d0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRestoreConfigSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkDevices RestoreConfig. */ +public final class NetworkDevicesRestoreConfigSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_restoreConfig_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_restoreConfig_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesRestoreConfigMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .restoreConfig("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdatePowerCycleSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdatePowerCycleSamples.java new file mode 100644 index 000000000000..e2382cdf1f82 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdatePowerCycleSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.PowerEnd; +import com.azure.resourcemanager.managednetworkfabric.models.State; +import com.azure.resourcemanager.managednetworkfabric.models.UpdatePowerCycleProperties; + +/** Samples for NetworkDevices UpdatePowerCycle. */ +public final class NetworkDevicesUpdatePowerCycleSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updatePowerCycle_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_updatePowerCycle_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdatePowerCycleMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .updatePowerCycle( + "resourceGroupName", + "networkDeviceName", + new UpdatePowerCycleProperties().withPowerEnd(PowerEnd.PRIMARY).withState(State.ON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java new file mode 100644 index 000000000000..16d5704f2690 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDevice; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkDevices Update. */ +public final class NetworkDevicesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkDevice resource = + manager + .networkDevices() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("keyID", "keyValue")) + .withHostname("networkDeviceName") + .withSerialNumber("Arista;DCS-7280PR3-24;12.05;JPE21330382") + .withAnnotation("null") + .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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateVersionSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateVersionSamples.java new file mode 100644 index 000000000000..5cd1f354126b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateVersionSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.UpdateVersionProperties; + +/** Samples for NetworkDevices UpdateVersion. */ +public final class NetworkDevicesUpdateVersionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkDevices_updateVersion_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkDevices_updateVersion_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkDevicesUpdateVersionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkDevices() + .updateVersion( + "resourceGroupName", + "networkDeviceName", + new UpdateVersionProperties().withSkuVersion("DefaultSku"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersCreateSamples.java new file mode 100644 index 000000000000..b3ea0dcd3795 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersCreateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerPropertiesManagedResourceGroupConfiguration; +import java.util.Arrays; + +/** Samples for NetworkFabricControllers Create. */ +public final class NetworkFabricControllersCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .define("NetworkControllerName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withManagedResourceGroupConfiguration( + new NetworkFabricControllerPropertiesManagedResourceGroupConfiguration() + .withName("managedResourceGroupName") + .withLocation("eastus")) + .withIpv4AddressSpace("172.253.0.0/19") + .withInfrastructureExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .withWorkloadExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .withAnnotation("lab 1") + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDeleteSamples.java new file mode 100644 index 000000000000..898b20febd67 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers Delete. */ +public final class NetworkFabricControllersDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .delete("resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDisableWorkloadManagementNetworkSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDisableWorkloadManagementNetworkSamples.java new file mode 100644 index 000000000000..b2e12fa7bb3c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDisableWorkloadManagementNetworkSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers DisableWorkloadManagementNetwork. */ +public final class NetworkFabricControllersDisableWorkloadManagementNetworkSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_disableWorkloadManagementNetwork_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_disableWorkloadManagementNetwork_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersDisableWorkloadManagementNetworkMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .disableWorkloadManagementNetwork( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersEnableWorkloadManagementNetworkSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersEnableWorkloadManagementNetworkSamples.java new file mode 100644 index 000000000000..d67dc35476d2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersEnableWorkloadManagementNetworkSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers EnableWorkloadManagementNetwork. */ +public final class NetworkFabricControllersEnableWorkloadManagementNetworkSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_enableWorkloadManagementNetwork_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_enableWorkloadManagementNetwork_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersEnableWorkloadManagementNetworkMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .enableWorkloadManagementNetwork( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..87e7a9067d7b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers GetByResourceGroup. */ +public final class NetworkFabricControllersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabricControllers() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListByResourceGroupSamples.java new file mode 100644 index 000000000000..95c111c8eda1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers ListByResourceGroup. */ +public final class NetworkFabricControllersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricControllers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListSamples.java new file mode 100644 index 000000000000..f8182a998800 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabricControllers List. */ +public final class NetworkFabricControllersListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricControllers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersUpdateSamples.java new file mode 100644 index 000000000000..5c596c28b237 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricController; +import java.util.Arrays; + +/** Samples for NetworkFabricControllers Update. */ +public final class NetworkFabricControllersUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricControllers_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricControllersUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkFabricController resource = + manager + .networkFabricControllers() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkFabricControllerName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withWorkloadExpressRouteConnections( + Arrays + .asList( + new ExpressRouteConnectionInformation() + .withExpressRouteCircuitId( + "/subscriptions/xxxxx/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName") + .withExpressRouteAuthorizationKey("fakeTokenPlaceholder"))) + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetSamples.java new file mode 100644 index 000000000000..b33d9f308128 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabricSkus Get. */ +public final class NetworkFabricSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricSkus().getWithResponse("networkFabricSkuName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListSamples.java new file mode 100644 index 000000000000..4ba036169eca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabricSkus List. */ +public final class NetworkFabricSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabricSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabricSkus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java new file mode 100644 index 000000000000..b07e14d180c9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricPropertiesTerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBPropertiesAutoGenerated; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import java.util.Arrays; + +/** Samples for NetworkFabrics Create. */ +public final class NetworkFabricsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .define("FabricName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkFabricSku("M4-A400-A100-C16-aa") + .withRackCount(4) + .withServerCountPerRack(8) + .withIpv4Prefix("10.18.0.0/19") + .withIpv6Prefix("3FFE:FFFF:0:CD40::/59") + .withFabricAsn(29249) + .withNetworkFabricControllerId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTerminalServerConfiguration( + new NetworkFabricPropertiesTerminalServerConfiguration() + .withPrimaryIpv4Prefix("20.0.0.12/30") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a8/126") + .withSecondaryIpv4Prefix("20.0.0.13/30") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::ac/126") + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("123456")) + .withManagementNetworkConfiguration( + new NetworkFabricPropertiesManagementNetworkConfiguration() + .withInfrastructureVpnConfiguration( + new NetworkFabricPropertiesManagementNetworkConfigurationInfrastructureVpnConfiguration() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039")))) + .withWorkloadVpnConfiguration( + new NetworkFabricPropertiesManagementNetworkConfigurationWorkloadVpnConfiguration() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10050")) + .withExportRouteTargets(Arrays.asList("65046:10050"))))) + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeleteSamples.java new file mode 100644 index 000000000000..76b86010dc1a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabrics Delete. */ +public final class NetworkFabricsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .delete("rgNetworkFabrics", "lrhjxlxlhgvufessdcuetcwnto", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionSamples.java new file mode 100644 index 000000000000..1015ccef0da9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabrics Deprovision. */ +public final class NetworkFabricsDeprovisionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_deprovision_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsDeprovisionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().deprovision("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7aff3dc3fed2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkFabrics GetByResourceGroup. */ +public final class NetworkFabricsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkFabrics() + .getByResourceGroupWithResponse("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c2490049ae88 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabrics ListByResourceGroup. */ +public final class NetworkFabricsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().listByResourceGroup("rgNetworkFabrics", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListSamples.java new file mode 100644 index 000000000000..8a2a79bdeac8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabrics List. */ +public final class NetworkFabricsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionSamples.java new file mode 100644 index 000000000000..e4f9ba3ed845 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkFabrics Provision. */ +public final class NetworkFabricsProvisionSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_provision_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_provision_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsProvisionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkFabrics().provision("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java new file mode 100644 index 000000000000..ab498f794729 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchParametersTerminalServerConfiguration; + +/** Samples for NetworkFabrics Update. */ +public final class NetworkFabricsUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkFabrics_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkFabrics_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkFabricsUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkFabric resource = + manager + .networkFabrics() + .getByResourceGroupWithResponse("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTerminalServerConfiguration( + new TerminalServerPatchParametersTerminalServerConfiguration() + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("234567")) + .apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateSamples.java new file mode 100644 index 000000000000..98573183b22c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkInterfaces Create. */ +public final class NetworkInterfacesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .define("networkInterfaceName") + .withExistingNetworkDevice("resourceGroupName", "networkDeviceName") + .withAnnotation("null") + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesDeleteSamples.java new file mode 100644 index 000000000000..e16707faaf24 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkInterfaces Delete. */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .delete("resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetSamples.java new file mode 100644 index 000000000000..8bf4458aa697 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkInterfaces Get. */ +public final class NetworkInterfacesGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .getWithResponse( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetStatusSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetStatusSamples.java new file mode 100644 index 000000000000..7742d662097e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetStatusSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkInterfaces GetStatus. */ +public final class NetworkInterfacesGetStatusSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_getStatus_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_getStatus_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesGetStatusMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .getStatus( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListSamples.java new file mode 100644 index 000000000000..b5e61375b113 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkInterfaces List. */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_List_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkInterfaces().list("resourceGroupName", "networkDeviceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateSamples.java new file mode 100644 index 000000000000..ad8c506af340 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState; +import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState; + +/** Samples for NetworkInterfaces UpdateAdministrativeState. */ +public final class NetworkInterfacesUpdateAdministrativeStateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_updateAdministrativeState_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_updateAdministrativeState_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesUpdateAdministrativeStateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkInterfaces() + .updateAdministrativeState( + "resourceGroupName", + "networkDeviceName", + "networkInterfaceName", + new UpdateAdministrativeState().withState(AdministrativeState.ENABLE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateSamples.java new file mode 100644 index 000000000000..2f138f87cc01 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateSamples.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.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkInterface; + +/** Samples for NetworkInterfaces Update. */ +public final class NetworkInterfacesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkInterfaces_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkInterfaces_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkInterfacesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + NetworkInterface resource = + manager + .networkInterfaces() + .getWithResponse( + "resourceGroupName", "networkDeviceName", "networkInterfaceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withAnnotation("null").apply(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusGetSamples.java new file mode 100644 index 000000000000..816e3f36c792 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkRackSkus Get. */ +public final class NetworkRackSkusGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRackSkus_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRackSkusGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRackSkus().getWithResponse("networkRackSkuName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusListSamples.java new file mode 100644 index 000000000000..70652b9da77c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkRackSkus List. */ +public final class NetworkRackSkusListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRackSkus_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRackSkus_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRackSkusListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRackSkus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java new file mode 100644 index 000000000000..d2a15e0d6b97 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkRacks Create. */ +public final class NetworkRacksCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkRacks() + .define("networkRackName") + .withRegion("eastus") + .withExistingResourceGroup("resourceGroupName") + .withNetworkRackSku("RackSKU") + .withNetworkFabricId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/networkFabricName") + .withTags(mapOf("keyID", "keyValue")) + .withAnnotation("null") + .create(); + } + + @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksDeleteSamples.java new file mode 100644 index 000000000000..38ca23588bae --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkRacks Delete. */ +public final class NetworkRacksDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().delete("resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bc9c2a6970dc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkRacks GetByResourceGroup. */ +public final class NetworkRacksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkRacks() + .getByResourceGroupWithResponse("resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupSamples.java new file mode 100644 index 000000000000..2d4a94ec07a2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkRacks ListByResourceGroup. */ +public final class NetworkRacksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListSamples.java new file mode 100644 index 000000000000..ec273d4b3583 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for NetworkRacks List. */ +public final class NetworkRacksListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.networkRacks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java new file mode 100644 index 000000000000..0e12229ecb03 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRack; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for NetworkRacks Update. */ +public final class NetworkRacksUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkRacks_Update_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkRacks_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkRacksUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) throws IOException { + NetworkRack resource = + manager + .networkRacks() + .getByResourceGroupWithResponse( + "resourceGroupName", "networkRackName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("keyID", "keyValue")) + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateSamples.java new file mode 100644 index 000000000000..84653ae31fd0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnectPropertiesLayer2Configuration; + +/** Samples for NetworkToNetworkInterconnects Create. */ +public final class NetworkToNetworkInterconnectsCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .define("DefaultNNI") + .withExistingNetworkFabric("resourceGroupName", "FabricName") + .withIsManagementType(BooleanEnumProperty.TRUE) + .withUseOptionB(BooleanEnumProperty.FALSE) + .withLayer2Configuration( + new NetworkToNetworkInterconnectPropertiesLayer2Configuration().withPortCount(10).withMtu(1500)) + .withLayer3Configuration( + new Layer3Configuration() + .withPrimaryIpv4Prefix("172.31.0.0/31") + .withPrimaryIpv6Prefix("3FFE:FFFF:0:CD30::a0/126") + .withSecondaryIpv4Prefix("172.31.0.20/31") + .withSecondaryIpv6Prefix("3FFE:FFFF:0:CD30::a4/126") + .withImportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName1") + .withExportRoutePolicyId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2") + .withPeerAsn(50272) + .withVlanId(2064)) + .create(); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsDeleteSamples.java new file mode 100644 index 000000000000..65c3a48d0a8e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsDeleteSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkToNetworkInterconnects Delete. */ +public final class NetworkToNetworkInterconnectsDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .delete("resourceGroupName", "FabricName", "DefaultNNI", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetSamples.java new file mode 100644 index 000000000000..e29dd65de542 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkToNetworkInterconnects Get. */ +public final class NetworkToNetworkInterconnectsGetSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .getWithResponse("resourceGroupName", "FabricName", "DefaultNNI", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListSamples.java new file mode 100644 index 000000000000..3f3f8f698ee4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListSamples.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.managednetworkfabric.generated; + +/** Samples for NetworkToNetworkInterconnects List. */ +public final class NetworkToNetworkInterconnectsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/NetworkToNetworkInterconnects_List_MaximumSet_Gen.json + */ + /** + * Sample code: NetworkToNetworkInterconnects_List_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void networkToNetworkInterconnectsListMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .networkToNetworkInterconnects() + .list("resourceGroupName", "FabricName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListSamples.java new file mode 100644 index 000000000000..7be397106cf2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/ListOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void listOperations( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java new file mode 100644 index 000000000000..629a4a60b04c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItem; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItemAction; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsItemMatch; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyPropertiesConditionsProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RoutePolicies Create. */ +public final class RoutePoliciesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Create_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .routePolicies() + .define("example RoutePolicy") + .withRegion("EastUS") + .withExistingResourceGroup("rgRoutePolicies") + .withTags(mapOf("key8254", "")) + .withDescription("RPexample") + .withConditions( + Arrays + .asList( + new RoutePolicyPropertiesConditionsItem() + .withAnnotation("") + .withSequenceNumber(7) + .withMatch( + new RoutePolicyPropertiesConditionsItemMatch() + .withAccessControlListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/accessControlLists/accessControlListName")) + .withIpCommunityListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/ipCommunityLists/ipCommunityListName")) + .withIpExtendedCommunityListIds(Arrays.asList(""))) + .withAction( + new RoutePolicyPropertiesConditionsItemAction() + .withAction("allow") + .withSet( + new Components1Qbx3T1SchemasRoutepolicypropertiesPropertiesConditionsItemsPropertiesActionPropertiesSet() + .withSet( + new RoutePolicyPropertiesConditionsProperties() + .withIpCommunityListIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/ipCommunityLists/ipCommunityListName")) + .withIpExtendedCommunityListIds(Arrays.asList(""))))))) + .withAnnotation("example routepolicy") + .create(); + } + + @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/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesDeleteSamples.java new file mode 100644 index 000000000000..6af4654f7250 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for RoutePolicies Delete. */ +public final class RoutePoliciesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().delete("rgRoutePolicies", "aaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..c9211a0bf04c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupSamples.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.managednetworkfabric.generated; + +/** Samples for RoutePolicies GetByResourceGroup. */ +public final class RoutePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Get_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .routePolicies() + .getByResourceGroupWithResponse("rgRoutePolicies", "aaaaaaa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..da8756f9f986 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for RoutePolicies ListByResourceGroup. */ +public final class RoutePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().listByResourceGroup("rgRoutePolicies", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListSamples.java new file mode 100644 index 000000000000..6df645458795 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +/** Samples for RoutePolicies List. */ +public final class RoutePoliciesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.routePolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java new file mode 100644 index 000000000000..402a4b3736d4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RoutePolicies Update. */ +public final class RoutePoliciesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/RoutePolicies_Update_MaximumSet_Gen.json + */ + /** + * Sample code: RoutePolicies_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void routePoliciesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) throws IOException { + RoutePolicy resource = + manager + .routePolicies() + .getByResourceGroupWithResponse( + "rgRoutePolicies", "aaaaaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1917", "aaaaaaaaaaaaa")) + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .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/managednetworkfabric/ci.yml b/sdk/managednetworkfabric/ci.yml new file mode 100644 index 000000000000..07af3d966b8a --- /dev/null +++ b/sdk/managednetworkfabric/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.yml + - sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/ + exclude: + - sdk/managednetworkfabric/pom.xml + - sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.yml + - sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/ + exclude: + - sdk/managednetworkfabric/pom.xml + - sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml + +parameters: + - name: release_azureresourcemanagermanagednetworkfabric + displayName: azure-resourcemanager-managednetworkfabric + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: managednetworkfabric + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-managednetworkfabric + groupId: com.azure.resourcemanager + safeName: azureresourcemanagermanagednetworkfabric + releaseInBatch: ${{ parameters.release_azureresourcemanagermanagednetworkfabric }} diff --git a/sdk/managednetworkfabric/pom.xml b/sdk/managednetworkfabric/pom.xml new file mode 100644 index 000000000000..fce68731aaab --- /dev/null +++ b/sdk/managednetworkfabric/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-managednetworkfabric-service + pom + 1.0.0 + + + azure-resourcemanager-managednetworkfabric + +