From fda1a1b0cedd513ca51e93637ca6dc40c5ba546a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 20 Jun 2023 15:30:17 +0000 Subject: [PATCH] CodeGen from PR 24515 in Azure/azure-rest-api-specs Merge d688e13e2b52b3ed66e9d182d8fbde731be94b78 into eae8ca2f90c2deb68688f5b1bbba9a5efcc0e42e --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 3906 ++++++++++++++++ .../pom.xml | 61 + .../ManagednetworkfabricManager.java | 572 +++ .../fluent/AccessControlListsClient.java | 201 + ...zureNetworkFabricManagementServiceApi.java | 179 + .../fluent/ExternalNetworksClient.java | 745 ++++ .../fluent/InternalNetworksClient.java | 831 ++++ .../fluent/IpCommunitiesClient.java | 301 ++ .../fluent/IpExtendedCommunitiesClient.java | 306 ++ .../fluent/IpPrefixesClient.java | 301 ++ .../fluent/L2IsolationDomainsClient.java | 579 +++ .../fluent/L3IsolationDomainsClient.java | 584 +++ .../fluent/NetworkDeviceSkusClient.java | 70 + .../fluent/NetworkDevicesClient.java | 834 ++++ .../NetworkFabricControllersClient.java | 443 ++ .../fluent/NetworkFabricSkusClient.java | 70 + .../fluent/NetworkFabricsClient.java | 425 ++ .../fluent/NetworkInterfacesClient.java | 470 ++ .../fluent/NetworkRackSkusClient.java | 70 + .../fluent/NetworkRacksClient.java | 301 ++ .../NetworkToNetworkInterconnectsClient.java | 239 + .../fluent/OperationsClient.java | 38 + .../fluent/RoutePoliciesClient.java | 301 ++ .../fluent/models/AccessControlListInner.java | 164 + .../AccessControlListPatchProperties.java | 92 + .../models/AccessControlListProperties.java | 122 + .../fluent/models/ArpPropertiesInner.java | 178 + .../fluent/models/ExternalNetworkInner.java | 248 ++ .../ExternalNetworkPatchProperties.java | 173 + .../models/ExternalNetworkProperties.java | 247 ++ .../GetDeviceStatusPropertiesInner.java | 125 + ...namicInterfaceMapsPropertiesItemInner.java | 80 + ...taticInterfaceMapsPropertiesItemInner.java | 232 + .../fluent/models/InterfaceStatusInner.java | 144 + .../fluent/models/InternalNetworkInner.java | 338 ++ .../InternalNetworkPatchProperties.java | 233 + .../models/InternalNetworkProperties.java | 354 ++ .../fluent/models/IpCommunityInner.java | 179 + .../fluent/models/IpCommunityProperties.java | 145 + .../models/IpExtendedCommunityInner.java | 159 + .../models/IpExtendedCommunityProperties.java | 125 + .../fluent/models/IpPrefixInner.java | 139 + .../fluent/models/IpPrefixProperties.java | 89 + .../fluent/models/L2IsolationDomainInner.java | 199 + .../L2IsolationDomainPatchProperties.java | 60 + .../models/L2IsolationDomainProperties.java | 174 + .../fluent/models/L3IsolationDomainInner.java | 283 ++ .../L3IsolationDomainPatchProperties.java | 168 + .../models/L3IsolationDomainProperties.java | 277 ++ .../fluent/models/NetworkDeviceInner.java | 220 + ...etworkDevicePatchParametersProperties.java | 89 + .../models/NetworkDeviceProperties.java | 203 + .../fluent/models/NetworkDeviceSkuInner.java | 220 + .../models/NetworkDeviceSkuProperties.java | 219 + .../models/NetworkFabricControllerInner.java | 290 ++ ...rkFabricControllerPatchableProperties.java | 96 + .../NetworkFabricControllerProperties.java | 297 ++ .../fluent/models/NetworkFabricInner.java | 373 ++ ...etworkFabricPatchParametersProperties.java | 115 + .../models/NetworkFabricProperties.java | 408 ++ .../fluent/models/NetworkFabricSkuInner.java | 136 + .../models/NetworkFabricSkuProperties.java | 126 + .../fluent/models/NetworkInterfaceInner.java | 156 + .../NetworkInterfacePatchProperties.java | 33 + .../models/NetworkInterfaceProperties.java | 142 + .../fluent/models/NetworkRackInner.java | 171 + .../fluent/models/NetworkRackProperties.java | 133 + .../fluent/models/NetworkRackSkuInner.java | 195 + .../models/NetworkRackSkuProperties.java | 185 + .../NetworkToNetworkInterconnectInner.java | 198 + ...etworkToNetworkInterconnectProperties.java | 211 + .../fluent/models/OperationInner.java | 127 + .../fluent/models/RoutePolicyInner.java | 140 + .../fluent/models/RoutePolicyProperties.java | 89 + .../models/SupportPackagePropertiesInner.java | 59 + .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../implementation/AccessControlListImpl.java | 241 + .../AccessControlListsClientImpl.java | 1301 ++++++ .../AccessControlListsImpl.java | 181 + .../implementation/ArpPropertiesImpl.java | 49 + ...workFabricManagementServiceApiBuilder.java | 144 + ...NetworkFabricManagementServiceApiImpl.java | 542 +++ .../implementation/ExternalNetworkImpl.java | 317 ++ .../ExternalNetworksClientImpl.java | 3350 ++++++++++++++ .../implementation/ExternalNetworksImpl.java | 316 ++ .../GetDeviceStatusPropertiesImpl.java | 43 + ...ynamicInterfaceMapsPropertiesItemImpl.java | 54 + ...StaticInterfaceMapsPropertiesItemImpl.java | 61 + .../implementation/InterfaceStatusImpl.java | 50 + .../implementation/InternalNetworkImpl.java | 400 ++ .../InternalNetworksClientImpl.java | 3717 ++++++++++++++++ .../implementation/InternalNetworksImpl.java | 339 ++ .../IpCommunitiesClientImpl.java | 1628 +++++++ .../implementation/IpCommunitiesImpl.java | 170 + .../implementation/IpCommunityImpl.java | 235 + .../IpExtendedCommunitiesClientImpl.java | 1659 +++++++ .../IpExtendedCommunitiesImpl.java | 184 + .../IpExtendedCommunityImpl.java | 221 + .../implementation/IpPrefixImpl.java | 208 + .../implementation/IpPrefixesClientImpl.java | 1611 +++++++ .../implementation/IpPrefixesImpl.java | 170 + .../implementation/L2IsolationDomainImpl.java | 285 ++ .../L2IsolationDomainsClientImpl.java | 2848 ++++++++++++ .../L2IsolationDomainsImpl.java | 255 ++ .../implementation/L3IsolationDomainImpl.java | 346 ++ .../L3IsolationDomainsClientImpl.java | 2866 ++++++++++++ .../L3IsolationDomainsImpl.java | 221 + .../implementation/NetworkDeviceImpl.java | 326 ++ .../implementation/NetworkDeviceSkuImpl.java | 96 + .../NetworkDeviceSkusClientImpl.java | 456 ++ .../implementation/NetworkDeviceSkusImpl.java | 70 + .../NetworkDevicesClientImpl.java | 3941 +++++++++++++++++ .../implementation/NetworkDevicesImpl.java | 325 ++ .../NetworkFabricControllerImpl.java | 319 ++ .../NetworkFabricControllersClientImpl.java | 2272 ++++++++++ .../NetworkFabricControllersImpl.java | 206 + .../implementation/NetworkFabricImpl.java | 344 ++ .../implementation/NetworkFabricSkuImpl.java | 71 + .../NetworkFabricSkusClientImpl.java | 458 ++ .../implementation/NetworkFabricSkusImpl.java | 70 + .../NetworkFabricsClientImpl.java | 2170 +++++++++ .../implementation/NetworkFabricsImpl.java | 190 + .../implementation/NetworkInterfaceImpl.java | 211 + .../NetworkInterfacesClientImpl.java | 2211 +++++++++ .../implementation/NetworkInterfacesImpl.java | 250 ++ .../implementation/NetworkRackImpl.java | 228 + .../implementation/NetworkRackSkuImpl.java | 80 + .../NetworkRackSkusClientImpl.java | 456 ++ .../implementation/NetworkRackSkusImpl.java | 70 + .../NetworkRacksClientImpl.java | 1628 +++++++ .../implementation/NetworkRacksImpl.java | 170 + .../NetworkToNetworkInterconnectImpl.java | 171 + ...tworkToNetworkInterconnectsClientImpl.java | 1241 ++++++ .../NetworkToNetworkInterconnectsImpl.java | 218 + .../implementation/OperationImpl.java | 52 + .../implementation/OperationsClientImpl.java | 276 ++ .../implementation/OperationsImpl.java | 46 + .../RoutePoliciesClientImpl.java | 1628 +++++++ .../implementation/RoutePoliciesImpl.java | 170 + .../implementation/RoutePolicyImpl.java | 211 + .../SupportPackagePropertiesImpl.java | 33 + .../implementation/Utils.java | 204 + .../implementation/package-info.java | 9 + .../models/AccessControlList.java | 302 ++ .../AccessControlListConditionProperties.java | 250 ++ .../models/AccessControlListPatch.java | 142 + .../models/AccessControlLists.java | 183 + .../models/AccessControlListsListResult.java | 81 + .../models/ActionIpCommunityProperties.java | 91 + .../ActionIpExtendedCommunityProperties.java | 91 + .../models/ActionType.java | 44 + .../models/AddressFamily.java | 47 + .../models/AdministrativeState.java | 47 + .../models/AggregateRoute.java | 50 + .../models/AggregateRouteConfiguration.java | 83 + .../models/AllowASOverride.java | 47 + .../models/AnnotationResource.java | 50 + .../models/ArpProperties.java | 52 + .../models/BfdConfiguration.java | 69 + .../models/BgpConfiguration.java | 295 ++ .../models/BooleanEnumProperty.java | 47 + .../models/CommunityActionTypes.java | 47 + .../models/Condition.java | 50 + .../models/ConditionActionType.java | 47 + .../models/ConnectedSubnet.java | 59 + .../models/DeviceInterfaceProperties.java | 107 + .../models/DeviceLimits.java | 182 + .../models/EnableDisableOnResources.java | 51 + .../models/EnabledDisabledState.java | 47 + .../ExpressRouteConnectionInformation.java | 98 + .../models/ExternalNetwork.java | 468 ++ .../models/ExternalNetworkPatch.java | 181 + .../ExternalNetworkPatchableProperties.java | 160 + ...nalNetworkPropertiesOptionAProperties.java | 81 + .../models/ExternalNetworks.java | 362 ++ .../models/ExternalNetworksList.java | 81 + .../models/FabricBfdConfiguration.java | 54 + .../models/GetDeviceStatusProperties.java | 39 + ...GetDynamicInterfaceMapsPropertiesItem.java | 60 + .../GetStaticInterfaceMapsPropertiesItem.java | 74 + .../models/InfrastructureServices.java | 82 + .../models/InterfaceStatus.java | 52 + .../models/InterfaceType.java | 47 + .../models/InternalNetwork.java | 586 +++ .../models/InternalNetworkPatch.java | 228 + .../InternalNetworkPatchableProperties.java | 220 + .../models/InternalNetworks.java | 402 ++ .../models/InternalNetworksList.java | 81 + .../models/IpCommunities.java | 180 + .../models/IpCommunitiesListResult.java | 81 + .../models/IpCommunity.java | 288 ++ .../IpCommunityAddOperationProperties.java | 53 + .../IpCommunityDeleteOperationProperties.java | 53 + .../models/IpCommunityIdList.java | 51 + .../models/IpCommunityPatch.java | 53 + .../IpCommunitySetOperationProperties.java | 53 + .../models/IpExtendedCommunities.java | 180 + .../models/IpExtendedCommunity.java | 278 ++ ...tendedCommunityAddOperationProperties.java | 53 + ...dedCommunityDeleteOperationProperties.java | 53 + .../models/IpExtendedCommunityIdList.java | 51 + .../models/IpExtendedCommunityListResult.java | 81 + .../models/IpExtendedCommunityPatch.java | 53 + ...tendedCommunitySetOperationProperties.java | 53 + .../managednetworkfabric/models/IpPrefix.java | 250 ++ .../models/IpPrefixPatch.java | 53 + .../IpPrefixPropertiesIpPrefixRulesItem.java | 181 + .../models/IpPrefixes.java | 179 + .../models/IpPrefixesListResult.java | 81 + .../models/IsCurrentVersion.java | 47 + .../models/IsTestVersion.java | 47 + .../models/L2IsolationDomain.java | 424 ++ .../models/L2IsolationDomainPatch.java | 118 + .../models/L2IsolationDomains.java | 301 ++ .../models/L2IsolationDomainsListResult.java | 81 + .../models/L3IsolationDomain.java | 523 +++ .../models/L3IsolationDomainPatch.java | 190 + ...hPropertiesConnectedSubnetRoutePolicy.java | 66 + .../models/L3IsolationDomains.java | 302 ++ .../models/L3IsolationDomainsListResult.java | 81 + .../models/Layer2Configuration.java | 92 + .../models/Layer3Configuration.java | 173 + .../models/Layer3IpPrefixProperties.java | 164 + .../models/Layer3OptionAProperties.java | 176 + .../ManagedResourceGroupConfiguration.java | 76 + .../ManagementNetworkConfiguration.java | 98 + .../models/NeighborAddress.java | 65 + .../models/NetworkDevice.java | 549 +++ .../models/NetworkDevicePatchParameters.java | 143 + .../NetworkDevicePatchableProperties.java | 79 + .../models/NetworkDeviceRackRoleType.java | 56 + .../models/NetworkDeviceRoleName.java | 56 + .../models/NetworkDeviceRoleProperties.java | 102 + .../models/NetworkDeviceRoleTypes.java | 56 + .../models/NetworkDeviceSku.java | 96 + .../models/NetworkDeviceSkus.java | 63 + .../models/NetworkDeviceSkusListResult.java | 81 + .../models/NetworkDevices.java | 416 ++ .../models/NetworkDevicesListResult.java | 81 + .../models/NetworkFabric.java | 514 +++ .../models/NetworkFabricController.java | 465 ++ ...tworkFabricControllerOperationalState.java | 51 + .../models/NetworkFabricControllerPatch.java | 137 + .../models/NetworkFabricControllers.java | 235 + .../NetworkFabricControllersListResult.java | 81 + .../models/NetworkFabricOperationalState.java | 62 + .../models/NetworkFabricPatchParameters.java | 150 + .../NetworkFabricPatchableProperties.java | 72 + .../models/NetworkFabricSku.java | 88 + .../models/NetworkFabricSkus.java | 63 + .../models/NetworkFabricSkusListResult.java | 81 + .../models/NetworkFabrics.java | 234 + .../models/NetworkFabricsListResult.java | 81 + .../models/NetworkInterface.java | 262 ++ .../models/NetworkInterfacePatch.java | 66 + .../models/NetworkInterfaces.java | 234 + .../models/NetworkInterfacesList.java | 81 + .../models/NetworkRack.java | 285 ++ .../models/NetworkRackPatch.java | 79 + .../models/NetworkRackRoleName.java | 47 + .../models/NetworkRackSku.java | 89 + .../models/NetworkRackSkus.java | 63 + .../models/NetworkRackSkusListResult.java | 81 + .../models/NetworkRacks.java | 180 + .../models/NetworkRacksListResult.java | 81 + .../models/NetworkToNetworkInterconnect.java | 211 + .../models/NetworkToNetworkInterconnects.java | 165 + .../NetworkToNetworkInterconnectsList.java | 81 + .../managednetworkfabric/models/NniType.java | 47 + .../models/Operation.java | 56 + .../models/OperationDisplay.java | 91 + .../models/OperationListResult.java | 62 + .../models/OperationalStatus.java | 50 + .../models/Operations.java | 33 + .../models/OptionAProperties.java | 161 + .../models/OptionBProperties.java | 77 + .../OptionBPropertiesAutoGenerated.java | 92 + .../managednetworkfabric/models/Origin.java | 53 + .../models/PeeringOption.java | 47 + .../models/PowerCycleState.java | 47 + .../managednetworkfabric/models/PowerEnd.java | 47 + .../models/ProvisioningState.java | 56 + .../models/RedistributeConnectedSubnets.java | 47 + .../models/RedistributeStaticRoutes.java | 47 + .../models/RoutePolicies.java | 180 + .../models/RoutePoliciesListResult.java | 81 + .../models/RoutePolicy.java | 250 ++ .../models/RoutePolicyPatch.java | 53 + .../RoutePolicyStatementProperties.java | 130 + .../managednetworkfabric/models/State.java | 47 + .../models/StatementActionProperties.java | 144 + .../models/StatementConditionProperties.java | 86 + .../models/StaticRouteConfiguration.java | 112 + .../models/StaticRouteProperties.java | 90 + .../models/SupportPackageProperties.java | 24 + .../models/SupportedConnectorProperties.java | 76 + .../models/SupportedVersionProperties.java | 154 + .../models/TerminalServerConfiguration.java | 147 + .../models/TerminalServerPatchParameters.java | 56 + .../TerminalServerPatchableProperties.java | 102 + .../models/UpdateAdministrativeState.java | 60 + .../models/UpdatePowerCycleProperties.java | 91 + .../models/UpdateVersionProperties.java | 59 + .../models/VpnConfigurationProperties.java | 147 + .../models/WellKnownCommunities.java | 60 + .../models/WorkloadServices.java | 80 + .../models/package-info.java | 9 + .../managednetworkfabric/package-info.java | 9 + .../src/main/java/module-info.java | 19 + .../AccessControlListsCreateSamples.java | 43 + .../AccessControlListsDeleteSamples.java | 23 + ...ControlListsGetByResourceGroupSamples.java | 23 + ...ontrolListsListByResourceGroupSamples.java | 21 + .../AccessControlListsListSamples.java | 21 + .../AccessControlListsUpdateSamples.java | 46 + ...xternalNetworksClearArpEntriesSamples.java | 35 + ...rnalNetworksClearIpv6NeighborsSamples.java | 35 + .../ExternalNetworksCreateSamples.java | 50 + .../ExternalNetworksDeleteSamples.java | 24 + .../generated/ExternalNetworksGetSamples.java | 24 + .../ExternalNetworksListSamples.java | 21 + ...worksUpdateAdministrativeStateSamples.java | 37 + ...teBfdForBgpAdministrativeStateSamples.java | 37 + ...ksUpdateBgpAdministrativeStateSamples.java | 37 + .../ExternalNetworksUpdateSamples.java | 59 + ...nternalNetworksClearArpEntriesSamples.java | 35 + ...rnalNetworksClearIpv6NeighborsSamples.java | 35 + .../InternalNetworksCreateSamples.java | 69 + .../InternalNetworksDeleteSamples.java | 24 + .../generated/InternalNetworksGetSamples.java | 24 + .../InternalNetworksListSamples.java | 21 + ...worksUpdateAdministrativeStateSamples.java | 37 + ...teBfdForBgpAdministrativeStateSamples.java | 37 + ...StaticRouteAdministrativeStateSamples.java | 37 + ...ksUpdateBgpAdministrativeStateSamples.java | 37 + .../InternalNetworksUpdateSamples.java | 76 + .../generated/IpCommunitiesCreateSamples.java | 54 + .../generated/IpCommunitiesDeleteSamples.java | 21 + ...pCommunitiesGetByResourceGroupSamples.java | 24 + ...CommunitiesListByResourceGroupSamples.java | 21 + .../generated/IpCommunitiesListSamples.java | 21 + .../generated/IpCommunitiesUpdateSamples.java | 42 + .../IpExtendedCommunitiesCreateSamples.java | 46 + .../IpExtendedCommunitiesDeleteSamples.java | 23 + ...dCommunitiesGetByResourceGroupSamples.java | 24 + ...CommunitiesListByResourceGroupSamples.java | 23 + .../IpExtendedCommunitiesListSamples.java | 21 + .../IpExtendedCommunitiesUpdateSamples.java | 42 + .../generated/IpPrefixesCreateSamples.java | 55 + .../generated/IpPrefixesDeleteSamples.java | 21 + .../IpPrefixesGetByResourceGroupSamples.java | 23 + .../IpPrefixesListByResourceGroupSamples.java | 21 + .../generated/IpPrefixesListSamples.java | 21 + .../generated/IpPrefixesUpdateSamples.java | 42 + ...2IsolationDomainsClearArpTableSamples.java | 34 + ...ationDomainsClearNeighborTableSamples.java | 34 + .../L2IsolationDomainsCreateSamples.java | 30 + .../L2IsolationDomainsDeleteSamples.java | 21 + ...2IsolationDomainsGetArpEntriesSamples.java | 23 + ...ationDomainsGetByResourceGroupSamples.java | 24 + ...tionDomainsListByResourceGroupSamples.java | 21 + .../L2IsolationDomainsListSamples.java | 21 + ...mainsUpdateAdministrativeStateSamples.java | 36 + .../L2IsolationDomainsUpdateSamples.java | 29 + ...3IsolationDomainsClearArpTableSamples.java | 34 + ...ationDomainsClearNeighborTableSamples.java | 30 + .../L3IsolationDomainsCreateSamples.java | 46 + .../L3IsolationDomainsDeleteSamples.java | 21 + ...ationDomainsGetByResourceGroupSamples.java | 23 + ...tionDomainsListByResourceGroupSamples.java | 21 + .../L3IsolationDomainsListSamples.java | 21 + ...mainsUpdateAdministrativeStateSamples.java | 36 + ...dateOptionBAdministrativeStateSamples.java | 36 + .../L3IsolationDomainsUpdateSamples.java | 48 + .../NetworkDeviceSkusGetSamples.java | 21 + .../NetworkDeviceSkusListSamples.java | 21 + .../NetworkDevicesCreateSamples.java | 47 + .../NetworkDevicesDeleteSamples.java | 21 + ...kDevicesGenerateSupportPackageSamples.java | 23 + ...tworkDevicesGetByResourceGroupSamples.java | 23 + ...DevicesGetDynamicInterfaceMapsSamples.java | 23 + ...kDevicesGetStaticInterfaceMapsSamples.java | 23 + .../NetworkDevicesGetStatusSamples.java | 21 + ...workDevicesListByResourceGroupSamples.java | 21 + .../generated/NetworkDevicesListSamples.java | 21 + .../NetworkDevicesRebootSamples.java | 21 + .../NetworkDevicesRestoreConfigSamples.java | 23 + ...NetworkDevicesUpdatePowerCycleSamples.java | 31 + .../NetworkDevicesUpdateSamples.java | 48 + .../NetworkDevicesUpdateVersionSamples.java | 29 + ...NetworkFabricControllersCreateSamples.java | 48 + ...NetworkFabricControllersDeleteSamples.java | 23 + ...sableWorkloadManagementNetworkSamples.java | 24 + ...nableWorkloadManagementNetworkSamples.java | 24 + ...cControllersGetByResourceGroupSamples.java | 24 + ...ControllersListByResourceGroupSamples.java | 21 + .../NetworkFabricControllersListSamples.java | 21 + ...NetworkFabricControllersUpdateSamples.java | 40 + .../NetworkFabricSkusGetSamples.java | 21 + .../NetworkFabricSkusListSamples.java | 21 + .../NetworkFabricsCreateSamples.java | 100 + .../NetworkFabricsDeleteSamples.java | 23 + .../NetworkFabricsDeprovisionSamples.java | 21 + ...tworkFabricsGetByResourceGroupSamples.java | 23 + ...workFabricsListByResourceGroupSamples.java | 21 + .../generated/NetworkFabricsListSamples.java | 21 + .../NetworkFabricsProvisionSamples.java | 21 + .../NetworkFabricsUpdateSamples.java | 51 + .../NetworkInterfacesCreateSamples.java | 26 + .../NetworkInterfacesDeleteSamples.java | 23 + .../NetworkInterfacesGetSamples.java | 24 + .../NetworkInterfacesGetStatusSamples.java | 24 + .../NetworkInterfacesListSamples.java | 21 + ...facesUpdateAdministrativeStateSamples.java | 31 + .../NetworkInterfacesUpdateSamples.java | 29 + .../generated/NetworkRackSkusGetSamples.java | 21 + .../generated/NetworkRackSkusListSamples.java | 21 + .../generated/NetworkRacksCreateSamples.java | 45 + .../generated/NetworkRacksDeleteSamples.java | 21 + ...NetworkRacksGetByResourceGroupSamples.java | 23 + ...etworkRacksListByResourceGroupSamples.java | 21 + .../generated/NetworkRacksListSamples.java | 21 + .../generated/NetworkRacksUpdateSamples.java | 52 + ...rkToNetworkInterconnectsCreateSamples.java | 46 + ...rkToNetworkInterconnectsDeleteSamples.java | 23 + ...tworkToNetworkInterconnectsGetSamples.java | 23 + ...workToNetworkInterconnectsListSamples.java | 23 + .../generated/OperationsListSamples.java | 21 + .../generated/RoutePoliciesCreateSamples.java | 113 + .../generated/RoutePoliciesDeleteSamples.java | 21 + ...outePoliciesGetByResourceGroupSamples.java | 23 + ...utePoliciesListByResourceGroupSamples.java | 21 + .../generated/RoutePoliciesListSamples.java | 21 + .../generated/RoutePoliciesUpdateSamples.java | 42 + sdk/managednetworkfabric/ci.yml | 47 + sdk/managednetworkfabric/pom.xml | 15 + 441 files changed, 90788 insertions(+) create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/README.md create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagednetworkfabricManager.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AccessControlListsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AzureNetworkFabricManagementServiceApi.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/ExternalNetworksClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/InternalNetworksClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunitiesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpExtendedCommunitiesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L2IsolationDomainsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/L3IsolationDomainsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDeviceSkusClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkDevicesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricControllersClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricSkusClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkFabricsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkInterfacesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRackSkusClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkRacksClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/NetworkToNetworkInterconnectsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/OperationsClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/RoutePoliciesClient.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ArpPropertiesInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkPatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/ExternalNetworkProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDeviceStatusPropertiesInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetDynamicInterfaceMapsPropertiesItemInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/GetStaticInterfaceMapsPropertiesItemInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InterfaceStatusInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkPatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainPatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L2IsolationDomainProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainPatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/L3IsolationDomainProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDevicePatchParametersProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerPatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricControllerProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricPatchParametersProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricSkuProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfacePatchProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkInterfaceProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/OperationInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/SupportPackagePropertiesInner.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/package-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/package-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ArpPropertiesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiBuilder.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworkImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/ExternalNetworksImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDeviceStatusPropertiesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetDynamicInterfaceMapsPropertiesItemImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/GetStaticInterfaceMapsPropertiesItemImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InterfaceStatusImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworkImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworksImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunityImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L2IsolationDomainsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/L3IsolationDomainsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkuImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDeviceSkusImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkDevicesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllerImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricControllersImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkuImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricSkusImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfaceImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkInterfacesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkuImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRackSkusImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkRacksImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/OperationsImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesClientImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePoliciesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/SupportPackagePropertiesImpl.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/Utils.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/package-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListConditionProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlLists.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListsListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpCommunityProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpExtendedCommunityProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionType.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AddressFamily.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AdministrativeState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRoute.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRouteConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AllowASOverride.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AnnotationResource.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ArpProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BfdConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BgpConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BooleanEnumProperty.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionTypes.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Condition.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConditionActionType.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConnectedSubnet.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceInterfaceProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceLimits.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnableDisableOnResources.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnabledDisabledState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExpressRouteConnectionInformation.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetwork.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworkPropertiesOptionAProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworks.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExternalNetworksList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/FabricBfdConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDeviceStatusProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDynamicInterfaceMapsPropertiesItem.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetStaticInterfaceMapsPropertiesItem.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InfrastructureServices.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceStatus.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceType.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetwork.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworks.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworksList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunities.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitiesListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunity.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityAddOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityDeleteOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityIdList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitySetOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunities.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunity.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityAddOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityDeleteOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityIdList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunitySetOperationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefix.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPropertiesIpPrefixRulesItem.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixes.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixesListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsCurrentVersion.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IsTestVersion.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomain.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomains.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L2IsolationDomainsListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomain.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomains.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainsListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer2Configuration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3Configuration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3IpPrefixProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3OptionAProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagedResourceGroupConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagementNetworkConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NeighborAddress.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevice.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchParameters.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicePatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRackRoleType.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleName.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleTypes.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSku.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkus.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkusListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevices.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevicesListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricController.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerOperationalState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllerPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllers.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllersListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricOperationalState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchParameters.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricPatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkus.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSkusListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabrics.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricsListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterface.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacePatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfaces.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkInterfacesList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRack.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackRoleName.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSku.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkus.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkusListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacks.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRacksListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnects.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnectsList.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NniType.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operation.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationDisplay.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OperationalStatus.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Operations.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBPropertiesAutoGenerated.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Origin.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PeeringOption.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerCycleState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/PowerEnd.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ProvisioningState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeConnectedSubnets.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RedistributeStaticRoutes.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicies.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePoliciesListResult.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyStatementProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/State.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementActionProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementConditionProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportPackageProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedConnectorProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedVersionProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerConfiguration.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParameters.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchableProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateAdministrativeState.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdatePowerCycleProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/UpdateVersionProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VpnConfigurationProperties.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WellKnownCommunities.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WorkloadServices.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/package-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/package-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/module-info.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/AccessControlListsUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearArpEntriesSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksClearIpv6NeighborsSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateBgpAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/ExternalNetworksUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearArpEntriesSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksClearIpv6NeighborsSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForBgpAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBfdForStaticRouteAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateBgpAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearArpTableSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearNeighborTableSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetArpEntriesSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearArpTableSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsClearNeighborTableSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateOptionBAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDeviceSkusListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGenerateSupportPackageSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetDynamicInterfaceMapsSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStaticInterfaceMapsSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesGetStatusSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRebootSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesRestoreConfigSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdatePowerCycleSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkDevicesUpdateVersionSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersDisableWorkloadManagementNetworkSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersEnableWorkloadManagementNetworkSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricSkusListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeprovisionSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsProvisionSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesGetStatusSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateAdministrativeStateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRackSkusListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkRacksUpdateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsGetSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/OperationsListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesDeleteSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesGetByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListByResourceGroupSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesListSamples.java create mode 100644 sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java create mode 100644 sdk/managednetworkfabric/ci.yml create mode 100644 sdk/managednetworkfabric/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c010422648c04..ac9b8071e6761 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -414,6 +414,7 @@ com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0-beta.1;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-cosmosdbforpostgresql;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-managementgroups;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 7b1217c460151..5ce2ac0b51aea 100644 --- a/pom.xml +++ b/pom.xml @@ -110,6 +110,7 @@ sdk/machinelearningservices sdk/maintenance sdk/managedapplications + sdk/managednetworkfabric sdk/managementgroups sdk/maps sdk/mariadb diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md new file mode 100644 index 0000000000000..af5ab5954f720 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-06-20) + +- 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 0000000000000..ca2a5b4e8fd47 --- /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 0000000000000..a8973ba4fb350 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/SAMPLE.md @@ -0,0 +1,3906 @@ +# 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) + +## IpCommunities + +- [Create](#ipcommunities_create) +- [Delete](#ipcommunities_delete) +- [GetByResourceGroup](#ipcommunities_getbyresourcegroup) +- [List](#ipcommunities_list) +- [ListByResourceGroup](#ipcommunities_listbyresourcegroup) +- [Update](#ipcommunities_update) + +## IpExtendedCommunities + +- [Create](#ipextendedcommunities_create) +- [Delete](#ipextendedcommunities_delete) +- [GetByResourceGroup](#ipextendedcommunities_getbyresourcegroup) +- [List](#ipextendedcommunities_list) +- [ListByResourceGroup](#ipextendedcommunities_listbyresourcegroup) +- [Update](#ipextendedcommunities_update) + +## IpPrefixes + +- [Create](#ipprefixes_create) +- [Delete](#ipprefixes_delete) +- [GetByResourceGroup](#ipprefixes_getbyresourcegroup) +- [List](#ipprefixes_list) +- [ListByResourceGroup](#ipprefixes_listbyresourcegroup) +- [Update](#ipprefixes_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.AccessControlListConditionProperties; +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 AccessControlListConditionProperties() + .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.AccessControlListConditionProperties; +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) + .withConditions( + Arrays + .asList( + new AccessControlListConditionProperties() + .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.Layer3OptionAProperties; +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 Layer3OptionAProperties() + .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.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; +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 ConnectedSubnet().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets(Arrays.asList(new ConnectedSubnet().withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new StaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new BgpConfiguration() + .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 NeighborAddress().withAddress("10.1.0.0"))) + .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress().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.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; +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 ConnectedSubnet().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets(Arrays.asList(new ConnectedSubnet().withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new StaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new BgpConfiguration() + .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 NeighborAddress().withAddress("10.1.0.0"))) + .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress().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); + } +} +``` + +### IpCommunities_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunities Create. */ +public final class IpCommunitiesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunities() + .define("example-ipCommunity") + .withRegion("EastUS") + .withExistingResourceGroup("rgIpCommunityLists") + .withTags(mapOf("key2814", "")) + .withAction(CommunityActionTypes.PERMIT) + .withWellKnownCommunities( + Arrays + .asList( + WellKnownCommunities.INTERNET, + WellKnownCommunities.LOCAL_AS, + WellKnownCommunities.NO_EXPORT, + WellKnownCommunities.GSHUT)) + .withCommunityMembers(Arrays.asList("1234:5678")) + .withAnnotation("annotationValue") + .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; + } +} +``` + +### IpCommunities_Delete + +```java +/** Samples for IpCommunities Delete. */ +public final class IpCommunitiesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().delete("resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunities_GetByResourceGroup + +```java +/** Samples for IpCommunities GetByResourceGroup. */ +public final class IpCommunitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunities() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-ipCommunity", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunities_List + +```java +/** Samples for IpCommunities List. */ +public final class IpCommunitiesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunities_ListByResourceGroup + +```java +/** Samples for IpCommunities ListByResourceGroup. */ +public final class IpCommunitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### IpCommunities_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunities Update. */ +public final class IpCommunitiesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpCommunity resource = + manager + .ipCommunities() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-ipCommunity", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2814", "")).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; + } +} +``` + +### IpExtendedCommunities_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpExtendedCommunities Create. */ +public final class IpExtendedCommunitiesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .define("example_ipExtendedCommunity") + .withRegion("EastUs") + .withExistingResourceGroup("rgIpExtendedCommunityLists") + .withTags(mapOf("key5054", "key")) + .withAction(CommunityActionTypes.PERMIT) + .withRouteTargets(Arrays.asList("1234:5678")) + .withAnnotation("annotationValue") + .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; + } +} +``` + +### IpExtendedCommunities_Delete + +```java +/** Samples for IpExtendedCommunities Delete. */ +public final class IpExtendedCommunitiesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .delete("rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE); + } +} +``` + +### IpExtendedCommunities_GetByResourceGroup + +```java +/** Samples for IpExtendedCommunities GetByResourceGroup. */ +public final class IpExtendedCommunitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .getByResourceGroupWithResponse( + "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE); + } +} +``` + +### IpExtendedCommunities_List + +```java +/** Samples for IpExtendedCommunities List. */ +public final class IpExtendedCommunitiesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipExtendedCommunities().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpExtendedCommunities_ListByResourceGroup + +```java +/** Samples for IpExtendedCommunities ListByResourceGroup. */ +public final class IpExtendedCommunitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .listByResourceGroup("rgIpExtendedCommunityLists", com.azure.core.util.Context.NONE); + } +} +``` + +### IpExtendedCommunities_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpExtendedCommunities Update. */ +public final class IpExtendedCommunitiesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpExtendedCommunity resource = + manager + .ipExtendedCommunities() + .getByResourceGroupWithResponse( + "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5054", "key1")).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; + } +} +``` + +### IpPrefixes_Create + +```java +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.Condition; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPropertiesIpPrefixRulesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpPrefixes Create. */ +public final class IpPrefixesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixes() + .define("example-ipPrefix") + .withRegion("EastUS") + .withExistingResourceGroup("resourcegroupname") + .withIpPrefixRules( + Arrays + .asList( + new IpPrefixPropertiesIpPrefixRulesItem() + .withAction(CommunityActionTypes.PERMIT) + .withSequenceNumber(12L) + .withNetworkPrefix("1.1.1.0/24") + .withCondition(Condition.EQUAL_TO) + .withSubnetMaskLength(28))) + .withTags(mapOf("key6404", "")) + .withAnnotation("annotationValue") + .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; + } +} +``` + +### IpPrefixes_Delete + +```java +/** Samples for IpPrefixes Delete. */ +public final class IpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().delete("rgIpPrefixLists", "example-ipPrefix", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixes_GetByResourceGroup + +```java +/** Samples for IpPrefixes GetByResourceGroup. */ +public final class IpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixes() + .getByResourceGroupWithResponse("resourcegroupname", "example-ipPrefix", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixes_List + +```java +/** Samples for IpPrefixes List. */ +public final class IpPrefixesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixes_ListByResourceGroup + +```java +/** Samples for IpPrefixes ListByResourceGroup. */ +public final class IpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); + } +} +``` + +### IpPrefixes_Update + +```java +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpPrefixes Update. */ +public final class IpPrefixesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpPrefix resource = + manager + .ipPrefixes() + .getByResourceGroupWithResponse( + "resourcegroupname", "example-ipPrefix", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3127", "key")).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; + } +} +``` + +### 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.AggregateRoute; +import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; +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 AggregateRouteConfiguration() + .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.0/24"))) + .withIpv6Routes(Arrays.asList(new AggregateRoute().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.AggregateRoute; +import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +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 AggregateRouteConfiguration() + .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.0/24"))) + .withIpv6Routes(Arrays.asList(new AggregateRoute().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.ManagedResourceGroupConfiguration; +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 ManagedResourceGroupConfiguration().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.ManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBPropertiesAutoGenerated; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** 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("eastuseuap") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("key6468", "")) + .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 TerminalServerConfiguration() + .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 ManagementNetworkConfiguration() + .withInfrastructureVpnConfiguration( + new VpnConfigurationProperties() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new OptionAProperties() + .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") + .withMtu(5892) + .withVlanId(2724) + .withPeerAsn(42666))) + .withWorkloadVpnConfiguration( + new VpnConfigurationProperties() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10050")) + .withExportRouteTargets(Arrays.asList("65046:10050"))) + .withOptionAProperties( + new OptionAProperties() + .withPrimaryIpv4Prefix("10.0.0.14/30") + .withPrimaryIpv6Prefix("2FFE:FFFF:0:CD30::a7/126") + .withSecondaryIpv4Prefix("10.0.0.15/30") + .withSecondaryIpv6Prefix("2FFE:FFFF:0:CD30::ac/126") + .withMtu(5892) + .withVlanId(2724) + .withPeerAsn(42666)))) + .withAnnotation("annotationValue") + .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; + } +} +``` + +### 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.TerminalServerPatchableProperties; +import java.util.HashMap; +import java.util.Map; + +/** 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() + .withTags(mapOf("key1758", "")) + .withTerminalServerConfiguration( + new TerminalServerPatchableProperties() + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("234567")) + .withAnnotation("annotationValue") + .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; + } +} +``` + +### 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.Layer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NniType; + +/** 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") + .withNniType(NniType.CE) + .withIsManagementType(BooleanEnumProperty.TRUE) + .withUseOptionB(BooleanEnumProperty.FALSE) + .withLayer2Configuration(new Layer2Configuration().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.ActionIpCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; +import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; +import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; +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("routePolicyName") + .withRegion("EastUS") + .withExistingResourceGroup("rgRoutePolicies") + .withStatements( + Arrays + .asList( + new RoutePolicyStatementProperties() + .withAnnotation("annotationValue") + .withSequenceNumber(7L) + .withCondition( + new StatementConditionProperties() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")) + .withIpPrefixId( + "subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix") + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withAction( + new StatementActionProperties() + .withLocalPreference(20L) + .withActionType(CommunityActionTypes.PERMIT) + .withIpCommunityProperties( + new ActionIpCommunityProperties() + .withAdd( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName"))) + .withDelete( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName"))) + .withSet( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")))) + .withIpExtendedCommunityProperties( + new ActionIpExtendedCommunityProperties() + .withAdd( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withDelete( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withSet( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))))))) + .withTags(mapOf("key8254", "")) + .withAnnotation("annotationValue") + .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", "routePolicyName", 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", "routePolicyName", 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.resourcemanager.managednetworkfabric.models.RoutePolicy; +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) { + RoutePolicy resource = + manager + .routePolicies() + .getByResourceGroupWithResponse( + "resourceGroupName", "routePolicyName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8254", "")).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 0000000000000..6e9fe8e71a1c8 --- /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.40.0 + + + com.azure + azure-core-management + 1.11.2 + + + 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 0000000000000..c87f0f72a32c8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/ManagednetworkfabricManager.java @@ -0,0 +1,572 @@ +// Copyright (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.IpCommunitiesImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.IpExtendedCommunitiesImpl; +import com.azure.resourcemanager.managednetworkfabric.implementation.IpPrefixesImpl; +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.IpCommunities; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunities; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixes; +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 IpCommunities ipCommunities; + + private IpExtendedCommunities ipExtendedCommunities; + + private IpPrefixes ipPrefixes; + + 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 IpCommunities. It manages IpCommunity. + * + * @return Resource collection API of IpCommunities. + */ + public IpCommunities ipCommunities() { + if (this.ipCommunities == null) { + this.ipCommunities = new IpCommunitiesImpl(clientObject.getIpCommunities(), this); + } + return ipCommunities; + } + + /** + * Gets the resource collection API of IpExtendedCommunities. It manages IpExtendedCommunity. + * + * @return Resource collection API of IpExtendedCommunities. + */ + public IpExtendedCommunities ipExtendedCommunities() { + if (this.ipExtendedCommunities == null) { + this.ipExtendedCommunities = new IpExtendedCommunitiesImpl(clientObject.getIpExtendedCommunities(), this); + } + return ipExtendedCommunities; + } + + /** + * Gets the resource collection API of IpPrefixes. It manages IpPrefix. + * + * @return Resource collection API of IpPrefixes. + */ + public IpPrefixes ipPrefixes() { + if (this.ipPrefixes == null) { + this.ipPrefixes = new IpPrefixesImpl(clientObject.getIpPrefixes(), this); + } + return ipPrefixes; + } + + /** + * 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 0000000000000..9313b5f44ad04 --- /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 0000000000000..e70d96df5a819 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/AzureNetworkFabricManagementServiceApi.java @@ -0,0 +1,179 @@ +// Copyright (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 IpCommunitiesClient object to access its operations. + * + * @return the IpCommunitiesClient object. + */ + IpCommunitiesClient getIpCommunities(); + + /** + * Gets the IpExtendedCommunitiesClient object to access its operations. + * + * @return the IpExtendedCommunitiesClient object. + */ + IpExtendedCommunitiesClient getIpExtendedCommunities(); + + /** + * Gets the IpPrefixesClient object to access its operations. + * + * @return the IpPrefixesClient object. + */ + IpPrefixesClient getIpPrefixes(); + + /** + * 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 0000000000000..8996a36ef4011 --- /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 0000000000000..ed3665e0f0451 --- /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/IpCommunitiesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunitiesClient.java new file mode 100644 index 0000000000000..f356bf7a6f758 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpCommunitiesClient.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.IpCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityPatch; + +/** An instance of this class provides access to all the operations defined in IpCommunitiesClient. */ +public interface IpCommunitiesClient { + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpCommunityInner> beginCreate( + String resourceGroupName, String ipCommunityName, IpCommunityInner body); + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpCommunityInner> beginCreate( + String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context); + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityInner create(String resourceGroupName, String ipCommunityName, IpCommunityInner body); + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityInner create(String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context); + + /** + * Gets an IP Community. + * + *

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

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

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpCommunityInner> beginUpdate( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body); + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpCommunityInner> beginUpdate( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context); + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityInner update(String resourceGroupName, String ipCommunityName, IpCommunityPatch body); + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpCommunityInner update(String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context); + + /** + * Deletes an IP Community. + * + *

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipCommunityName); + + /** + * Deletes an IP Community. + * + *

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipCommunityName, Context context); + + /** + * Deletes an IP Community. + * + *

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

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipCommunityName, Context context); + + /** + * List IpCommunities by resource group. + * + *

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

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

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

Implements IpCommunities 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 IPCommunities 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/IpExtendedCommunitiesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpExtendedCommunitiesClient.java new file mode 100644 index 0000000000000..fb49d78927bd4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpExtendedCommunitiesClient.java @@ -0,0 +1,306 @@ +// Copyright (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.IpExtendedCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityPatch; + +/** An instance of this class provides access to all the operations defined in IpExtendedCommunitiesClient. */ +public interface IpExtendedCommunitiesClient { + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpExtendedCommunityInner> beginCreate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body); + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpExtendedCommunityInner> beginCreate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context); + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpExtendedCommunityInner create( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body); + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpExtendedCommunityInner create( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context); + + /** + * Gets an IP Extended Community. + * + *

Implements IP Extended Community GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpExtendedCommunity resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipExtendedCommunityName, Context context); + + /** + * Gets an IP Extended Community. + * + *

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

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpExtendedCommunityInner> beginUpdate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body); + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpExtendedCommunityInner> beginUpdate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context); + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpExtendedCommunityInner update( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body); + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpExtendedCommunityInner update( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context); + + /** + * Deletes the IP Extended Community. + * + *

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipExtendedCommunityName); + + /** + * Deletes the IP Extended Community. + * + *

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipExtendedCommunityName, Context context); + + /** + * Deletes the IP Extended Community. + * + *

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

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipExtendedCommunityName, Context context); + + /** + * List IpExtendedCommunities by resource group. + * + *

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

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

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

Implements IpExtendedCommunities 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 IpExtendedCommunities 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/IpPrefixesClient.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixesClient.java new file mode 100644 index 0000000000000..4ada7597e5240 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/IpPrefixesClient.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.IpPrefixInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatch; + +/** An instance of this class provides access to all the operations defined in IpPrefixesClient. */ +public interface IpPrefixesClient { + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixInner> beginCreate( + String resourceGroupName, String ipPrefixName, IpPrefixInner body); + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixInner> beginCreate( + String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context); + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixInner create(String resourceGroupName, String ipPrefixName, IpPrefixInner body); + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixInner create(String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context); + + /** + * Gets an IP Prefix. + * + *

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

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

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixInner> beginUpdate( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body); + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixInner> beginUpdate( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context); + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixInner update(String resourceGroupName, String ipPrefixName, IpPrefixPatch body); + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixInner update(String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context); + + /** + * Deletes the IP Prefix. + * + *

Implements IP Prefix DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipPrefixName); + + /** + * Deletes the IP Prefix. + * + *

Implements IP Prefix DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 ipPrefixName, Context context); + + /** + * Deletes the IP Prefix. + * + *

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

Implements IP Prefix DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipPrefixName, Context context); + + /** + * List IpPrefixes by resource group. + * + *

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

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

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

Implements IpPrefixes 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 IpPrefixes 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 0000000000000..f72b3a971b6b5 --- /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 0000000000000..72db75482a3d3 --- /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 0000000000000..8aebea12bb2a6 --- /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 0000000000000..ad4938c5ac87e --- /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 0000000000000..0e34ae7b847c9 --- /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 0000000000000..a31a13b26936d --- /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 0000000000000..9808d85563ded --- /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 0000000000000..c4d534f812cba --- /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 0000000000000..39fdae0cb7444 --- /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 0000000000000..1e377ea3235ef --- /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 0000000000000..88be04bfaa5e6 --- /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 0000000000000..883c288bb6058 --- /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 0000000000000..9269cca656372 --- /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 0000000000000..e4e5af6075631 --- /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.AccessControlListConditionProperties; +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 0000000000000..db3ca64c742c4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/AccessControlListPatchProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListConditionProperties; +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 0000000000000..28e9f2a0e7383 --- /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.AccessControlListConditionProperties; +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 0000000000000..e98ddf8c94e0e --- /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 0000000000000..ec4aa5c186924 --- /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 0000000000000..5685766bd6713 --- /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.Layer3OptionAProperties; +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 Layer3OptionAProperties 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 Layer3OptionAProperties 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(Layer3OptionAProperties 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 0000000000000..2b865fb2fa314 --- /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 0000000000000..f6d01e5983845 --- /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 0000000000000..4a0356ea20c76 --- /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 0000000000000..c744fd2a0b614 --- /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 0000000000000..ed336589dd7ff --- /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 0000000000000..07f4f26f71004 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkInner.java @@ -0,0 +1,338 @@ +// Copyright (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.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv4Subnets(); + } + + /** + * Set the connectedIPv4Subnets property: List with object connected IPv4 Subnets. + * + * @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 connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv6Subnets(); + } + + /** + * Set the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @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: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + public StaticRouteConfiguration staticRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().staticRouteConfiguration(); + } + + /** + * Set the staticRouteConfiguration property: Static Route Configuration properties. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkInner object itself. + */ + public InternalNetworkInner withStaticRouteConfiguration(StaticRouteConfiguration 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 BgpConfiguration 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(BgpConfiguration 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 0000000000000..fe154190ec4c9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkPatchProperties.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +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 connected IPv4 Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connected IPv6 Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * Static Route Configuration properties. + */ + @JsonProperty(value = "staticRouteConfiguration") + private StaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private BgpConfiguration 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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connected IPv4 Subnets. + * + * @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 connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @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: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + public StaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: Static Route Configuration properties. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatchProperties object itself. + */ + public InternalNetworkPatchProperties withStaticRouteConfiguration( + StaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public BgpConfiguration 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(BgpConfiguration 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 0000000000000..1e245516f9afe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/InternalNetworkProperties.java @@ -0,0 +1,354 @@ +// Copyright (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.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +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 connected IPv4 Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connected IPv6 Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * Static Route Configuration properties. + */ + @JsonProperty(value = "staticRouteConfiguration") + private StaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private BgpConfiguration 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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connected IPv4 Subnets. + * + * @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 connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @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: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + public StaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: Static Route Configuration properties. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkProperties object itself. + */ + public InternalNetworkProperties withStaticRouteConfiguration(StaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public BgpConfiguration 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(BgpConfiguration 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/IpCommunityInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityInner.java new file mode 100644 index 0000000000000..c5fcedef86e77 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityInner.java @@ -0,0 +1,179 @@ +// Copyright (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.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpCommunity resource definition. */ +@Fluent +public final class IpCommunityInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private IpCommunityProperties 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 IpCommunityInner class. */ + public IpCommunityInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpCommunityProperties 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 IpCommunityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpCommunityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + public CommunityActionTypes action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @param action the action value to set. + * @return the IpCommunityInner object itself. + */ + public IpCommunityInner withAction(CommunityActionTypes action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the wellKnownCommunities property: Supported well known Community List. + * + * @return the wellKnownCommunities value. + */ + public List wellKnownCommunities() { + return this.innerProperties() == null ? null : this.innerProperties().wellKnownCommunities(); + } + + /** + * Set the wellKnownCommunities property: Supported well known Community List. + * + * @param wellKnownCommunities the wellKnownCommunities value to set. + * @return the IpCommunityInner object itself. + */ + public IpCommunityInner withWellKnownCommunities(List wellKnownCommunities) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityProperties(); + } + this.innerProperties().withWellKnownCommunities(wellKnownCommunities); + return this; + } + + /** + * Get the communityMembers property: List the communityMembers of IP Community . + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.innerProperties() == null ? null : this.innerProperties().communityMembers(); + } + + /** + * Set the communityMembers property: List the communityMembers of IP Community . + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityInner object itself. + */ + public IpCommunityInner withCommunityMembers(List communityMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityProperties(); + } + this.innerProperties().withCommunityMembers(communityMembers); + 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 IpCommunityInner object itself. + */ + public IpCommunityInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpCommunityProperties(); + } + 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/IpCommunityProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityProperties.java new file mode 100644 index 0000000000000..83a00d4972a15 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpCommunityProperties.java @@ -0,0 +1,145 @@ +// Copyright (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.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IpCommunityProperties define the resource properties. */ +@Fluent +public final class IpCommunityProperties extends AnnotationResource { + /* + * Action to be taken on the configuration. Example: Permit | Deny. + */ + @JsonProperty(value = "action", required = true) + private CommunityActionTypes action; + + /* + * Supported well known Community List. + */ + @JsonProperty(value = "wellKnownCommunities") + private List wellKnownCommunities; + + /* + * List the communityMembers of IP Community . + */ + @JsonProperty(value = "communityMembers", required = true) + private List communityMembers; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of IpCommunityProperties class. */ + public IpCommunityProperties() { + } + + /** + * Get the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + public CommunityActionTypes action() { + return this.action; + } + + /** + * Set the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @param action the action value to set. + * @return the IpCommunityProperties object itself. + */ + public IpCommunityProperties withAction(CommunityActionTypes action) { + this.action = action; + return this; + } + + /** + * Get the wellKnownCommunities property: Supported well known Community List. + * + * @return the wellKnownCommunities value. + */ + public List wellKnownCommunities() { + return this.wellKnownCommunities; + } + + /** + * Set the wellKnownCommunities property: Supported well known Community List. + * + * @param wellKnownCommunities the wellKnownCommunities value to set. + * @return the IpCommunityProperties object itself. + */ + public IpCommunityProperties withWellKnownCommunities(List wellKnownCommunities) { + this.wellKnownCommunities = wellKnownCommunities; + return this; + } + + /** + * Get the communityMembers property: List the communityMembers of IP Community . + * + * @return the communityMembers value. + */ + public List communityMembers() { + return this.communityMembers; + } + + /** + * Set the communityMembers property: List the communityMembers of IP Community . + * + * @param communityMembers the communityMembers value to set. + * @return the IpCommunityProperties object itself. + */ + public IpCommunityProperties withCommunityMembers(List communityMembers) { + this.communityMembers = communityMembers; + 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 IpCommunityProperties 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 IpCommunityProperties")); + } + if (communityMembers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property communityMembers in model IpCommunityProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpCommunityProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityInner.java new file mode 100644 index 0000000000000..20949e62a1d5c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityInner.java @@ -0,0 +1,159 @@ +// Copyright (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.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpExtendedCommunity resource definition. */ +@Fluent +public final class IpExtendedCommunityInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private IpExtendedCommunityProperties 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 IpExtendedCommunityInner class. */ + public IpExtendedCommunityInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpExtendedCommunityProperties 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 IpExtendedCommunityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpExtendedCommunityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + public CommunityActionTypes action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @param action the action value to set. + * @return the IpExtendedCommunityInner object itself. + */ + public IpExtendedCommunityInner withAction(CommunityActionTypes action) { + if (this.innerProperties() == null) { + this.innerProperties = new IpExtendedCommunityProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The + * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. + * + * @return the routeTargets value. + */ + public List routeTargets() { + return this.innerProperties() == null ? null : this.innerProperties().routeTargets(); + } + + /** + * Set the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The + * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. + * + * @param routeTargets the routeTargets value to set. + * @return the IpExtendedCommunityInner object itself. + */ + public IpExtendedCommunityInner withRouteTargets(List routeTargets) { + if (this.innerProperties() == null) { + this.innerProperties = new IpExtendedCommunityProperties(); + } + this.innerProperties().withRouteTargets(routeTargets); + 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 IpExtendedCommunityInner object itself. + */ + public IpExtendedCommunityInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpExtendedCommunityProperties(); + } + 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/IpExtendedCommunityProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityProperties.java new file mode 100644 index 0000000000000..04aca5b164ac3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpExtendedCommunityProperties.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.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IpExtendedCommunityProperties define the resource properties. */ +@Fluent +public final class IpExtendedCommunityProperties extends AnnotationResource { + /* + * Action to be taken on the configuration. Example: Permit | Deny. + */ + @JsonProperty(value = "action", required = true) + private CommunityActionTypes action; + + /* + * Route Target List.The expected formats are ASN(plain):NN >> example 4294967294:50, ASN.ASN:NN >> example + * 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The possible values of ASN,NN are in range of + * 0-65535, ASN(plain) is in range of 0-4294967295. + */ + @JsonProperty(value = "routeTargets", required = true) + private List routeTargets; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of IpExtendedCommunityProperties class. */ + public IpExtendedCommunityProperties() { + } + + /** + * Get the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + public CommunityActionTypes action() { + return this.action; + } + + /** + * Set the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @param action the action value to set. + * @return the IpExtendedCommunityProperties object itself. + */ + public IpExtendedCommunityProperties withAction(CommunityActionTypes action) { + this.action = action; + return this; + } + + /** + * Get the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The + * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. + * + * @return the routeTargets value. + */ + public List routeTargets() { + return this.routeTargets; + } + + /** + * Set the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The + * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. + * + * @param routeTargets the routeTargets value to set. + * @return the IpExtendedCommunityProperties object itself. + */ + public IpExtendedCommunityProperties withRouteTargets(List routeTargets) { + this.routeTargets = routeTargets; + 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 IpExtendedCommunityProperties 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 IpExtendedCommunityProperties")); + } + if (routeTargets() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property routeTargets in model IpExtendedCommunityProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpExtendedCommunityProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixInner.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixInner.java new file mode 100644 index 0000000000000..6ea115ecf52ba --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixInner.java @@ -0,0 +1,139 @@ +// Copyright (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.IpPrefixPropertiesIpPrefixRulesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IPPrefix resource definition. */ +@Fluent +public final class IpPrefixInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties", required = true) + private IpPrefixProperties innerProperties = new IpPrefixProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of IpPrefixInner class. */ + public IpPrefixInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private IpPrefixProperties 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 IpPrefixInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public IpPrefixInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects. + * + * @return the ipPrefixRules value. + */ + public List ipPrefixRules() { + return this.innerProperties() == null ? null : this.innerProperties().ipPrefixRules(); + } + + /** + * Set the ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects. + * + * @param ipPrefixRules the ipPrefixRules value to set. + * @return the IpPrefixInner object itself. + */ + public IpPrefixInner withIpPrefixRules(List ipPrefixRules) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixProperties(); + } + this.innerProperties().withIpPrefixRules(ipPrefixRules); + 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 IpPrefixInner object itself. + */ + public IpPrefixInner withAnnotation(String annotation) { + if (this.innerProperties() == null) { + this.innerProperties = new IpPrefixProperties(); + } + 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 IpPrefixInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixInner.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixProperties.java new file mode 100644 index 0000000000000..ba92a0d1a7622 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/IpPrefixProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPropertiesIpPrefixRulesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IpPrefixProperties define the resource properties. */ +@Fluent +public final class IpPrefixProperties extends AnnotationResource { + /* + * IpPrefix contains the list of IP PrefixRules objects. + */ + @JsonProperty(value = "ipPrefixRules", required = true) + private List ipPrefixRules; + + /* + * Gets the provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** Creates an instance of IpPrefixProperties class. */ + public IpPrefixProperties() { + } + + /** + * Get the ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects. + * + * @return the ipPrefixRules value. + */ + public List ipPrefixRules() { + return this.ipPrefixRules; + } + + /** + * Set the ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects. + * + * @param ipPrefixRules the ipPrefixRules value to set. + * @return the IpPrefixProperties object itself. + */ + public IpPrefixProperties withIpPrefixRules(List ipPrefixRules) { + this.ipPrefixRules = ipPrefixRules; + 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 IpPrefixProperties 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 (ipPrefixRules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipPrefixRules in model IpPrefixProperties")); + } else { + ipPrefixRules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixProperties.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 0000000000000..f971807ec1e0c --- /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 0000000000000..420d1daab2646 --- /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 0000000000000..02f0e2089c731 --- /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 0000000000000..06497d23c98ab --- /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.AggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +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 AggregateRouteConfiguration 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( + AggregateRouteConfiguration 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 0000000000000..cba26e4e98f46 --- /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.AggregateRouteConfiguration; +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 AggregateRouteConfiguration 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 AggregateRouteConfiguration 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( + AggregateRouteConfiguration 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 0000000000000..d4afcfd120759 --- /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.AggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState; +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 AggregateRouteConfiguration 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 AggregateRouteConfiguration 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( + AggregateRouteConfiguration 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 0000000000000..098dce4844722 --- /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 0000000000000..99675999a9bb6 --- /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 0000000000000..86357c3a791fb --- /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 0000000000000..bcee56e99d3c2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuInner.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.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; +import com.azure.resourcemanager.managednetworkfabric.models.DeviceLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; +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 DeviceLimits 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(DeviceLimits 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 0000000000000..84766046331d3 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkDeviceSkuProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties; +import com.azure.resourcemanager.managednetworkfabric.models.DeviceLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; +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 DeviceLimits 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 DeviceLimits 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(DeviceLimits 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 0000000000000..549f9fb8ae194 --- /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.InfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WorkloadServices; +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 InfrastructureServices infrastructureServices() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureServices(); + } + + /** + * Get the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + public WorkloadServices workloadServices() { + return this.innerProperties() == null ? null : this.innerProperties().workloadServices(); + } + + /** + * Get the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration 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( + ManagedResourceGroupConfiguration 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 0000000000000..0a6dfacff0da7 --- /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 0000000000000..5d3f32a5bf4cd --- /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.InfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricControllerOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WorkloadServices; +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 InfrastructureServices infrastructureServices; + + /* + * WorkloadServices IP ranges. + */ + @JsonProperty(value = "workloadServices", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadServices workloadServices; + + /* + * Managed Resource Group configuration properties. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedResourceGroupConfiguration 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 InfrastructureServices infrastructureServices() { + return this.infrastructureServices; + } + + /** + * Get the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + public WorkloadServices workloadServices() { + return this.workloadServices; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration 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( + ManagedResourceGroupConfiguration 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 0000000000000..dcd5f767fe99b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkFabricInner.java @@ -0,0 +1,373 @@ +// Copyright (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.ManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; +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. Example: 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. Example: 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. Example: 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. Example: 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 TerminalServerConfiguration 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(TerminalServerConfiguration 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 ManagementNetworkConfiguration 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( + ManagementNetworkConfiguration 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 0000000000000..853c922672619 --- /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.TerminalServerPatchableProperties; +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 TerminalServerPatchableProperties 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 TerminalServerPatchableProperties 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( + TerminalServerPatchableProperties 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 0000000000000..5d55b9e8c8db2 --- /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.ManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; +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. Example: 10.1.0.0/19. + */ + @JsonProperty(value = "ipv4Prefix") + private String ipv4Prefix; + + /* + * IPv6Prefix for Management Network. Example: 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 TerminalServerConfiguration terminalServerConfiguration; + + /* + * Configuration to be used to setup the management network. + */ + @JsonProperty(value = "managementNetworkConfiguration", required = true) + private ManagementNetworkConfiguration 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. Example: 10.1.0.0/19. + * + * @return the ipv4Prefix value. + */ + public String ipv4Prefix() { + return this.ipv4Prefix; + } + + /** + * Set the ipv4Prefix property: IPv4Prefix for Management Network. Example: 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. Example: 3FFE:FFFF:0:CD40::/59. + * + * @return the ipv6Prefix value. + */ + public String ipv6Prefix() { + return this.ipv6Prefix; + } + + /** + * Set the ipv6Prefix property: IPv6Prefix for Management Network. Example: 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 TerminalServerConfiguration 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( + TerminalServerConfiguration terminalServerConfiguration) { + this.terminalServerConfiguration = terminalServerConfiguration; + return this; + } + + /** + * Get the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @return the managementNetworkConfiguration value. + */ + public ManagementNetworkConfiguration 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( + ManagementNetworkConfiguration 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 0000000000000..c08fce376e9a3 --- /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 0000000000000..e7eb14029de3d --- /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 0000000000000..ae23193f61060 --- /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 0000000000000..2f6ae67f3ed71 --- /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 0000000000000..eeb1c5ecc2a2c --- /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 0000000000000..474a09dcf33c8 --- /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 0000000000000..d7fb339fb4c02 --- /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 0000000000000..c30ff7f8539b5 --- /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.NetworkDeviceRoleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +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 0000000000000..c7c3cc6ac62fc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkRackSkuProperties.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.NetworkDeviceRoleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +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 0000000000000..e4f449addb4b9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectInner.java @@ -0,0 +1,198 @@ +// Copyright (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.Layer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NniType; +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 nniType property: Type of NNI used. Example: CE | NPB. + * + * @return the nniType value. + */ + public NniType nniType() { + return this.innerProperties() == null ? null : this.innerProperties().nniType(); + } + + /** + * Set the nniType property: Type of NNI used. Example: CE | NPB. + * + * @param nniType the nniType value to set. + * @return the NetworkToNetworkInterconnectInner object itself. + */ + public NetworkToNetworkInterconnectInner withNniType(NniType nniType) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkToNetworkInterconnectProperties(); + } + this.innerProperties().withNniType(nniType); + return this; + } + + /** + * 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 Layer2Configuration 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(Layer2Configuration 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 0000000000000..1ed8a512b5d56 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/NetworkToNetworkInterconnectProperties.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.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.Layer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NniType; +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 { + /* + * Type of NNI used. Example: CE | NPB + */ + @JsonProperty(value = "nniType") + private NniType nniType; + + /* + * 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 Layer2Configuration 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 nniType property: Type of NNI used. Example: CE | NPB. + * + * @return the nniType value. + */ + public NniType nniType() { + return this.nniType; + } + + /** + * Set the nniType property: Type of NNI used. Example: CE | NPB. + * + * @param nniType the nniType value to set. + * @return the NetworkToNetworkInterconnectProperties object itself. + */ + public NetworkToNetworkInterconnectProperties withNniType(NniType nniType) { + this.nniType = nniType; + return this; + } + + /** + * 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 Layer2Configuration 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(Layer2Configuration 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 0000000000000..2b27416d88bb8 --- /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 0000000000000..8c814741e20fe --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyInner.java @@ -0,0 +1,140 @@ +// Copyright (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.RoutePolicyStatementProperties; +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 statements property: Route Policy statements. + * + * @return the statements value. + */ + public List statements() { + return this.innerProperties() == null ? null : this.innerProperties().statements(); + } + + /** + * Set the statements property: Route Policy statements. + * + * @param statements the statements value to set. + * @return the RoutePolicyInner object itself. + */ + public RoutePolicyInner withStatements(List statements) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePolicyProperties(); + } + this.innerProperties().withStatements(statements); + 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 0000000000000..6bae4a9402d85 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/fluent/models/RoutePolicyProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RoutePolicy Properties define the resource properties. */ +@Fluent +public final class RoutePolicyProperties extends AnnotationResource { + /* + * Route Policy statements. + */ + @JsonProperty(value = "statements", required = true) + private List statements; + + /* + * 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 statements property: Route Policy statements. + * + * @return the statements value. + */ + public List statements() { + return this.statements; + } + + /** + * Set the statements property: Route Policy statements. + * + * @param statements the statements value to set. + * @return the RoutePolicyProperties object itself. + */ + public RoutePolicyProperties withStatements(List statements) { + this.statements = statements; + 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 (statements() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property statements in model RoutePolicyProperties")); + } else { + statements().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutePolicyProperties.class); +} 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 0000000000000..34e09bec9cddf --- /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 0000000000000..9ca6456f2f39c --- /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 0000000000000..af1662da0f083 --- /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 0000000000000..d8e16b75b4564 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AccessControlListImpl.java @@ -0,0 +1,241 @@ +// Copyright (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.AccessControlListConditionProperties; +import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListPatch; +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) { + if (isInCreateMode()) { + this.innerModel().withConditions(conditions); + return this; + } else { + this.updateBody.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; + } + } + + 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 0000000000000..ae0e69743b793 --- /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 0000000000000..fad48d0615041 --- /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 0000000000000..d306fbf923a21 --- /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 0000000000000..c8c9d78d60a42 --- /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 0000000000000..394bbcee7d927 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/AzureNetworkFabricManagementServiceApiImpl.java @@ -0,0 +1,542 @@ +// Copyright (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.IpCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpExtendedCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.IpPrefixesClient; +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 IpCommunitiesClient object to access its operations. */ + private final IpCommunitiesClient ipCommunities; + + /** + * Gets the IpCommunitiesClient object to access its operations. + * + * @return the IpCommunitiesClient object. + */ + public IpCommunitiesClient getIpCommunities() { + return this.ipCommunities; + } + + /** The IpExtendedCommunitiesClient object to access its operations. */ + private final IpExtendedCommunitiesClient ipExtendedCommunities; + + /** + * Gets the IpExtendedCommunitiesClient object to access its operations. + * + * @return the IpExtendedCommunitiesClient object. + */ + public IpExtendedCommunitiesClient getIpExtendedCommunities() { + return this.ipExtendedCommunities; + } + + /** The IpPrefixesClient object to access its operations. */ + private final IpPrefixesClient ipPrefixes; + + /** + * Gets the IpPrefixesClient object to access its operations. + * + * @return the IpPrefixesClient object. + */ + public IpPrefixesClient getIpPrefixes() { + return this.ipPrefixes; + } + + /** 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.ipCommunities = new IpCommunitiesClientImpl(this); + this.ipExtendedCommunities = new IpExtendedCommunitiesClientImpl(this); + this.ipPrefixes = new IpPrefixesClientImpl(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 0000000000000..2c6b24de5ac21 --- /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.Layer3OptionAProperties; +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(Layer3OptionAProperties 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 0000000000000..e562be301af95 --- /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 0000000000000..b7972e03dbaa0 --- /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 0000000000000..cf196faa609ab --- /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 0000000000000..15ac2f3aa17d2 --- /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 0000000000000..7ec9b31a51b30 --- /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 0000000000000..8e9dc20b718d3 --- /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 0000000000000..e6f9af6b38a9d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/InternalNetworkImpl.java @@ -0,0 +1,400 @@ +// Copyright (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.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +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.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +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 StaticRouteConfiguration staticRouteConfiguration() { + return this.innerModel().staticRouteConfiguration(); + } + + public BgpConfiguration 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(StaticRouteConfiguration staticRouteConfiguration) { + if (isInCreateMode()) { + this.innerModel().withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } else { + this.updateBody.withStaticRouteConfiguration(staticRouteConfiguration); + return this; + } + } + + public InternalNetworkImpl withBgpConfiguration(BgpConfiguration 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 0000000000000..60af1b285127f --- /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 0000000000000..cdaadc8177854 --- /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/IpCommunitiesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesClientImpl.java new file mode 100644 index 0000000000000..4fa9599da0946 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesClientImpl.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.IpCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunitiesListResult; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityPatch; +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 IpCommunitiesClient. */ +public final class IpCommunitiesClientImpl implements IpCommunitiesClient { + /** The proxy service used to perform REST calls. */ + private final IpCommunitiesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of IpCommunitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpCommunitiesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(IpCommunitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiIpCommunities to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface IpCommunitiesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}") + @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("ipCommunityName") String ipCommunityName, + @BodyParam("application/json") IpCommunityInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}") + @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("ipCommunityName") String ipCommunityName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}") + @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("ipCommunityName") String ipCommunityName, + @BodyParam("application/json") IpCommunityPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName}") + @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("ipCommunityName") String ipCommunityName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities") + @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/ipCommunities") + @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 an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner 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 (ipCommunityName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityName 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(), + ipCommunityName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner 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 (ipCommunityName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityName 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(), + ipCommunityName, + body, + accept, + context); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpCommunityInner> beginCreateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, ipCommunityName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpCommunityInner.class, + IpCommunityInner.class, + this.client.getContext()); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpCommunityInner> beginCreateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, ipCommunityName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpCommunityInner.class, IpCommunityInner.class, context); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpCommunityInner> beginCreate( + String resourceGroupName, String ipCommunityName, IpCommunityInner body) { + return this.beginCreateAsync(resourceGroupName, ipCommunityName, body).getSyncPoller(); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpCommunityInner> beginCreate( + String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, ipCommunityName, body, context).getSyncPoller(); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner body) { + return beginCreateAsync(resourceGroupName, ipCommunityName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context) { + return beginCreateAsync(resourceGroupName, ipCommunityName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityInner create(String resourceGroupName, String ipCommunityName, IpCommunityInner body) { + return createAsync(resourceGroupName, ipCommunityName, body).block(); + } + + /** + * Create an IP Community. + * + *

Implements an IP Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityInner create( + String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context) { + return createAsync(resourceGroupName, ipCommunityName, body, context).block(); + } + + /** + * Gets an IP Community. + * + *

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

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

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

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

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

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch 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 (ipCommunityName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityName 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(), + ipCommunityName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch 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 (ipCommunityName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipCommunityName 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(), + ipCommunityName, + body, + accept, + context); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpCommunityInner> beginUpdateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, ipCommunityName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpCommunityInner.class, + IpCommunityInner.class, + this.client.getContext()); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpCommunityInner> beginUpdateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, ipCommunityName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpCommunityInner.class, IpCommunityInner.class, context); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpCommunityInner> beginUpdate( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body) { + return this.beginUpdateAsync(resourceGroupName, ipCommunityName, body).getSyncPoller(); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpCommunityInner> beginUpdate( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, ipCommunityName, body, context).getSyncPoller(); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body) { + return beginUpdateAsync(resourceGroupName, ipCommunityName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, ipCommunityName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityInner update(String resourceGroupName, String ipCommunityName, IpCommunityPatch body) { + return updateAsync(resourceGroupName, ipCommunityName, body).block(); + } + + /** + * Updates an IP Community. + * + *

API to update certain properties of the IP Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param body IP Community 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 IpCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpCommunityInner update( + String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context) { + return updateAsync(resourceGroupName, ipCommunityName, body, context).block(); + } + + /** + * Deletes an IP Community. + * + *

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

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

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

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

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 ipCommunityName) { + return this.beginDeleteAsync(resourceGroupName, ipCommunityName).getSyncPoller(); + } + + /** + * Deletes an IP Community. + * + *

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

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

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

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

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipCommunityName, Context context) { + deleteAsync(resourceGroupName, ipCommunityName, context).block(); + } + + /** + * List IpCommunities by resource group. + * + *

Implements IpCommunities 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 IPCommunities 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 IpCommunities by resource group. + * + *

Implements IpCommunities 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 IPCommunities 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 IpCommunities by resource group. + * + *

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

Implements IpCommunities 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 IPCommunities 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 IpCommunities by resource group. + * + *

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

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

Implements IpCommunities 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 IPCommunities 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 IpCommunities by subscription. + * + *

Implements IpCommunities 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 IPCommunities 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 IpCommunities by subscription. + * + *

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

Implements IpCommunities 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 IPCommunities 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 IpCommunities by subscription. + * + *

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

Implements IpCommunities 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 IPCommunities 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 IPCommunities 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 IPCommunities 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 IPCommunities 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 IPCommunities 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/IpCommunitiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesImpl.java new file mode 100644 index 0000000000000..a8be79ab6c6dc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunitiesImpl.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.IpCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunities; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; + +public final class IpCommunitiesImpl implements IpCommunities { + private static final ClientLogger LOGGER = new ClientLogger(IpCommunitiesImpl.class); + + private final IpCommunitiesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public IpCommunitiesImpl( + IpCommunitiesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipCommunityName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpCommunityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IpCommunity getByResourceGroup(String resourceGroupName, String ipCommunityName) { + IpCommunityInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipCommunityName); + if (inner != null) { + return new IpCommunityImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ipCommunityName) { + this.serviceClient().delete(resourceGroupName, ipCommunityName); + } + + public void delete(String resourceGroupName, String ipCommunityName, Context context) { + this.serviceClient().delete(resourceGroupName, ipCommunityName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpCommunityImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpCommunityImpl(inner1, this.manager())); + } + + public IpCommunity 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 ipCommunityName = Utils.getValueFromIdByName(id, "ipCommunities"); + if (ipCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipCommunities'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipCommunityName, 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 ipCommunityName = Utils.getValueFromIdByName(id, "ipCommunities"); + if (ipCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipCommunities'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipCommunityName, 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 ipCommunityName = Utils.getValueFromIdByName(id, "ipCommunities"); + if (ipCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipCommunities'.", id))); + } + this.delete(resourceGroupName, ipCommunityName, 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 ipCommunityName = Utils.getValueFromIdByName(id, "ipCommunities"); + if (ipCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipCommunities'.", id))); + } + this.delete(resourceGroupName, ipCommunityName, context); + } + + private IpCommunitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public IpCommunityImpl define(String name) { + return new IpCommunityImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityImpl.java new file mode 100644 index 0000000000000..3bb4b6d9fa654 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpCommunityImpl.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.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.IpCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpCommunityImpl implements IpCommunity, IpCommunity.Definition, IpCommunity.Update { + private IpCommunityInner 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 CommunityActionTypes action() { + return this.innerModel().action(); + } + + public List wellKnownCommunities() { + List inner = this.innerModel().wellKnownCommunities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List communityMembers() { + List inner = this.innerModel().communityMembers(); + 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 IpCommunityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipCommunityName; + + private IpCommunityPatch updateBody; + + public IpCommunityImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpCommunity create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .create(resourceGroupName, ipCommunityName, this.innerModel(), Context.NONE); + return this; + } + + public IpCommunity create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .create(resourceGroupName, ipCommunityName, this.innerModel(), context); + return this; + } + + IpCommunityImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new IpCommunityInner(); + this.serviceManager = serviceManager; + this.ipCommunityName = name; + } + + public IpCommunityImpl update() { + this.updateBody = new IpCommunityPatch(); + return this; + } + + public IpCommunity apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .update(resourceGroupName, ipCommunityName, updateBody, Context.NONE); + return this; + } + + public IpCommunity apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .update(resourceGroupName, ipCommunityName, updateBody, context); + return this; + } + + IpCommunityImpl( + IpCommunityInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipCommunityName = Utils.getValueFromIdByName(innerObject.id(), "ipCommunities"); + } + + public IpCommunity refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .getByResourceGroupWithResponse(resourceGroupName, ipCommunityName, Context.NONE) + .getValue(); + return this; + } + + public IpCommunity refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpCommunities() + .getByResourceGroupWithResponse(resourceGroupName, ipCommunityName, context) + .getValue(); + return this; + } + + public IpCommunityImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpCommunityImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpCommunityImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public IpCommunityImpl withAction(CommunityActionTypes action) { + this.innerModel().withAction(action); + return this; + } + + public IpCommunityImpl withWellKnownCommunities(List wellKnownCommunities) { + this.innerModel().withWellKnownCommunities(wellKnownCommunities); + return this; + } + + public IpCommunityImpl withCommunityMembers(List communityMembers) { + this.innerModel().withCommunityMembers(communityMembers); + return this; + } + + public IpCommunityImpl 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/IpExtendedCommunitiesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesClientImpl.java new file mode 100644 index 0000000000000..a6484e63368dd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesClientImpl.java @@ -0,0 +1,1659 @@ +// Copyright (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.IpExtendedCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityListResult; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityPatch; +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 IpExtendedCommunitiesClient. */ +public final class IpExtendedCommunitiesClientImpl implements IpExtendedCommunitiesClient { + /** The proxy service used to perform REST calls. */ + private final IpExtendedCommunitiesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of IpExtendedCommunitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpExtendedCommunitiesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy + .create(IpExtendedCommunitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiIpExtendedCommunities to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface IpExtendedCommunitiesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}") + @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("ipExtendedCommunityName") String ipExtendedCommunityName, + @BodyParam("application/json") IpExtendedCommunityInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}") + @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("ipExtendedCommunityName") String ipExtendedCommunityName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}") + @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("ipExtendedCommunityName") String ipExtendedCommunityName, + @BodyParam("application/json") IpExtendedCommunityPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName}") + @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("ipExtendedCommunityName") String ipExtendedCommunityName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities") + @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/ipExtendedCommunities") + @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 an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner 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 (ipExtendedCommunityName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ipExtendedCommunityName 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(), + ipExtendedCommunityName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner 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 (ipExtendedCommunityName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ipExtendedCommunityName 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(), + ipExtendedCommunityName, + body, + accept, + context); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpExtendedCommunityInner> beginCreateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, ipExtendedCommunityName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpExtendedCommunityInner.class, + IpExtendedCommunityInner.class, + this.client.getContext()); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpExtendedCommunityInner> beginCreateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, ipExtendedCommunityName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpExtendedCommunityInner.class, + IpExtendedCommunityInner.class, + context); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpExtendedCommunityInner> beginCreate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body) { + return this.beginCreateAsync(resourceGroupName, ipExtendedCommunityName, body).getSyncPoller(); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpExtendedCommunityInner> beginCreate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, ipExtendedCommunityName, body, context).getSyncPoller(); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body) { + return beginCreateAsync(resourceGroupName, ipExtendedCommunityName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context) { + return beginCreateAsync(resourceGroupName, ipExtendedCommunityName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpExtendedCommunityInner create( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body) { + return createAsync(resourceGroupName, ipExtendedCommunityName, body).block(); + } + + /** + * Create an IP Extended Community. + * + *

Implements IP Extended Community PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpExtendedCommunityInner create( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityInner body, Context context) { + return createAsync(resourceGroupName, ipExtendedCommunityName, body, context).block(); + } + + /** + * Gets an IP Extended Community. + * + *

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

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

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

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

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

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch 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 (ipExtendedCommunityName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ipExtendedCommunityName 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(), + ipExtendedCommunityName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch 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 (ipExtendedCommunityName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter ipExtendedCommunityName 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(), + ipExtendedCommunityName, + body, + accept, + context); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpExtendedCommunityInner> beginUpdateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, ipExtendedCommunityName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpExtendedCommunityInner.class, + IpExtendedCommunityInner.class, + this.client.getContext()); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpExtendedCommunityInner> beginUpdateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, ipExtendedCommunityName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpExtendedCommunityInner.class, + IpExtendedCommunityInner.class, + context); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpExtendedCommunityInner> beginUpdate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body) { + return this.beginUpdateAsync(resourceGroupName, ipExtendedCommunityName, body).getSyncPoller(); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpExtendedCommunityInner> beginUpdate( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, ipExtendedCommunityName, body, context).getSyncPoller(); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body) { + return beginUpdateAsync(resourceGroupName, ipExtendedCommunityName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, ipExtendedCommunityName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpExtendedCommunityInner update( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body) { + return updateAsync(resourceGroupName, ipExtendedCommunityName, body).block(); + } + + /** + * Updates the IP Extended Community. + * + *

API to update certain properties of the IP Extended Community resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param body IP Extended Community 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 IpExtendedCommunity resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpExtendedCommunityInner update( + String resourceGroupName, String ipExtendedCommunityName, IpExtendedCommunityPatch body, Context context) { + return updateAsync(resourceGroupName, ipExtendedCommunityName, body, context).block(); + } + + /** + * Deletes the IP Extended Community. + * + *

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

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

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

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

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 ipExtendedCommunityName) { + return this.beginDeleteAsync(resourceGroupName, ipExtendedCommunityName).getSyncPoller(); + } + + /** + * Deletes the IP Extended Community. + * + *

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

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

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

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

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipExtendedCommunityName, Context context) { + deleteAsync(resourceGroupName, ipExtendedCommunityName, context).block(); + } + + /** + * List IpExtendedCommunities by resource group. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by resource group. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by resource group. + * + *

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

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by resource group. + * + *

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

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

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by subscription. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by subscription. + * + *

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

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities by subscription. + * + *

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

Implements IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities 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 IpExtendedCommunities 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/IpExtendedCommunitiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesImpl.java new file mode 100644 index 0000000000000..08229c613d1fc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunitiesImpl.java @@ -0,0 +1,184 @@ +// Copyright (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.IpExtendedCommunitiesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunities; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; + +public final class IpExtendedCommunitiesImpl implements IpExtendedCommunities { + private static final ClientLogger LOGGER = new ClientLogger(IpExtendedCommunitiesImpl.class); + + private final IpExtendedCommunitiesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public IpExtendedCommunitiesImpl( + IpExtendedCommunitiesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipExtendedCommunityName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipExtendedCommunityName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpExtendedCommunityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IpExtendedCommunity getByResourceGroup(String resourceGroupName, String ipExtendedCommunityName) { + IpExtendedCommunityInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, ipExtendedCommunityName); + if (inner != null) { + return new IpExtendedCommunityImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ipExtendedCommunityName) { + this.serviceClient().delete(resourceGroupName, ipExtendedCommunityName); + } + + public void delete(String resourceGroupName, String ipExtendedCommunityName, Context context) { + this.serviceClient().delete(resourceGroupName, ipExtendedCommunityName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpExtendedCommunityImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpExtendedCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpExtendedCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpExtendedCommunityImpl(inner1, this.manager())); + } + + public IpExtendedCommunity 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 ipExtendedCommunityName = Utils.getValueFromIdByName(id, "ipExtendedCommunities"); + if (ipExtendedCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipExtendedCommunities'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipExtendedCommunityName, 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 ipExtendedCommunityName = Utils.getValueFromIdByName(id, "ipExtendedCommunities"); + if (ipExtendedCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipExtendedCommunities'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipExtendedCommunityName, 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 ipExtendedCommunityName = Utils.getValueFromIdByName(id, "ipExtendedCommunities"); + if (ipExtendedCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipExtendedCommunities'.", + id))); + } + this.delete(resourceGroupName, ipExtendedCommunityName, 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 ipExtendedCommunityName = Utils.getValueFromIdByName(id, "ipExtendedCommunities"); + if (ipExtendedCommunityName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipExtendedCommunities'.", + id))); + } + this.delete(resourceGroupName, ipExtendedCommunityName, context); + } + + private IpExtendedCommunitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public IpExtendedCommunityImpl define(String name) { + return new IpExtendedCommunityImpl(name, this.manager()); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunityImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunityImpl.java new file mode 100644 index 0000000000000..63ff64cad059f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpExtendedCommunityImpl.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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpExtendedCommunityInner; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityPatch; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpExtendedCommunityImpl + implements IpExtendedCommunity, IpExtendedCommunity.Definition, IpExtendedCommunity.Update { + private IpExtendedCommunityInner 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 CommunityActionTypes action() { + return this.innerModel().action(); + } + + public List routeTargets() { + List inner = this.innerModel().routeTargets(); + 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 IpExtendedCommunityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipExtendedCommunityName; + + private IpExtendedCommunityPatch updateBody; + + public IpExtendedCommunityImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpExtendedCommunity create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .create(resourceGroupName, ipExtendedCommunityName, this.innerModel(), Context.NONE); + return this; + } + + public IpExtendedCommunity create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .create(resourceGroupName, ipExtendedCommunityName, this.innerModel(), context); + return this; + } + + IpExtendedCommunityImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new IpExtendedCommunityInner(); + this.serviceManager = serviceManager; + this.ipExtendedCommunityName = name; + } + + public IpExtendedCommunityImpl update() { + this.updateBody = new IpExtendedCommunityPatch(); + return this; + } + + public IpExtendedCommunity apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .update(resourceGroupName, ipExtendedCommunityName, updateBody, Context.NONE); + return this; + } + + public IpExtendedCommunity apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .update(resourceGroupName, ipExtendedCommunityName, updateBody, context); + return this; + } + + IpExtendedCommunityImpl( + IpExtendedCommunityInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipExtendedCommunityName = Utils.getValueFromIdByName(innerObject.id(), "ipExtendedCommunities"); + } + + public IpExtendedCommunity refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .getByResourceGroupWithResponse(resourceGroupName, ipExtendedCommunityName, Context.NONE) + .getValue(); + return this; + } + + public IpExtendedCommunity refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpExtendedCommunities() + .getByResourceGroupWithResponse(resourceGroupName, ipExtendedCommunityName, context) + .getValue(); + return this; + } + + public IpExtendedCommunityImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpExtendedCommunityImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpExtendedCommunityImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public IpExtendedCommunityImpl withAction(CommunityActionTypes action) { + this.innerModel().withAction(action); + return this; + } + + public IpExtendedCommunityImpl withRouteTargets(List routeTargets) { + this.innerModel().withRouteTargets(routeTargets); + return this; + } + + public IpExtendedCommunityImpl 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/IpPrefixImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixImpl.java new file mode 100644 index 0000000000000..d4e4846773921 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixImpl.java @@ -0,0 +1,208 @@ +// Copyright (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.IpPrefixInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatch; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPropertiesIpPrefixRulesItem; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpPrefixImpl implements IpPrefix, IpPrefix.Definition, IpPrefix.Update { + private IpPrefixInner 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 List ipPrefixRules() { + List inner = this.innerModel().ipPrefixRules(); + 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 IpPrefixInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ipPrefixName; + + private IpPrefixPatch updateBody; + + public IpPrefixImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IpPrefix create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixes() + .create(resourceGroupName, ipPrefixName, this.innerModel(), Context.NONE); + return this; + } + + public IpPrefix create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixes() + .create(resourceGroupName, ipPrefixName, this.innerModel(), context); + return this; + } + + IpPrefixImpl( + String name, com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = new IpPrefixInner(); + this.serviceManager = serviceManager; + this.ipPrefixName = name; + } + + public IpPrefixImpl update() { + this.updateBody = new IpPrefixPatch(); + return this; + } + + public IpPrefix apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixes() + .update(resourceGroupName, ipPrefixName, updateBody, Context.NONE); + return this; + } + + public IpPrefix apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getIpPrefixes().update(resourceGroupName, ipPrefixName, updateBody, context); + return this; + } + + IpPrefixImpl( + IpPrefixInner innerObject, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipPrefixName = Utils.getValueFromIdByName(innerObject.id(), "ipPrefixes"); + } + + public IpPrefix refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, ipPrefixName, Context.NONE) + .getValue(); + return this; + } + + public IpPrefix refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, ipPrefixName, context) + .getValue(); + return this; + } + + public IpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IpPrefixImpl withIpPrefixRules(List ipPrefixRules) { + this.innerModel().withIpPrefixRules(ipPrefixRules); + return this; + } + + public IpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public IpPrefixImpl 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/IpPrefixesClientImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesClientImpl.java new file mode 100644 index 0000000000000..ca112f2616253 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesClientImpl.java @@ -0,0 +1,1611 @@ +// Copyright (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.IpPrefixesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatch; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixesListResult; +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 IpPrefixesClient. */ +public final class IpPrefixesClientImpl implements IpPrefixesClient { + /** The proxy service used to perform REST calls. */ + private final IpPrefixesService service; + + /** The service client containing this operation class. */ + private final AzureNetworkFabricManagementServiceApiImpl client; + + /** + * Initializes an instance of IpPrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpPrefixesClientImpl(AzureNetworkFabricManagementServiceApiImpl client) { + this.service = + RestProxy.create(IpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureNetworkFabricManagementServiceApiIpPrefixes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureNetworkFabricMa") + public interface IpPrefixesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}") + @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("ipPrefixName") String ipPrefixName, + @BodyParam("application/json") IpPrefixInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}") + @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("ipPrefixName") String ipPrefixName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}") + @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("ipPrefixName") String ipPrefixName, + @BodyParam("application/json") IpPrefixPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName}") + @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("ipPrefixName") String ipPrefixName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes") + @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/ipPrefixes") + @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 an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipPrefixName, IpPrefixInner 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 (ipPrefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipPrefixName 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(), + ipPrefixName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String ipPrefixName, IpPrefixInner 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 (ipPrefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipPrefixName 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(), + ipPrefixName, + body, + accept, + context); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixInner> beginCreateAsync( + String resourceGroupName, String ipPrefixName, IpPrefixInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, ipPrefixName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpPrefixInner.class, + IpPrefixInner.class, + this.client.getContext()); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixInner> beginCreateAsync( + String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, ipPrefixName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpPrefixInner.class, IpPrefixInner.class, context); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixInner> beginCreate( + String resourceGroupName, String ipPrefixName, IpPrefixInner body) { + return this.beginCreateAsync(resourceGroupName, ipPrefixName, body).getSyncPoller(); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixInner> beginCreate( + String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, ipPrefixName, body, context).getSyncPoller(); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String ipPrefixName, IpPrefixInner body) { + return beginCreateAsync(resourceGroupName, ipPrefixName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context) { + return beginCreateAsync(resourceGroupName, ipPrefixName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixInner create(String resourceGroupName, String ipPrefixName, IpPrefixInner body) { + return createAsync(resourceGroupName, ipPrefixName, body).block(); + } + + /** + * Create an IP Prefix. + * + *

Implements IP Prefix PUT method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixInner create(String resourceGroupName, String ipPrefixName, IpPrefixInner body, Context context) { + return createAsync(resourceGroupName, ipPrefixName, body, context).block(); + } + + /** + * Gets an IP Prefix. + * + *

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

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

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

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

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

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipPrefixName, IpPrefixPatch 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 (ipPrefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipPrefixName 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(), + ipPrefixName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String ipPrefixName, IpPrefixPatch 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 (ipPrefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter ipPrefixName 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(), + ipPrefixName, + body, + accept, + context); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixInner> beginUpdateAsync( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, ipPrefixName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpPrefixInner.class, + IpPrefixInner.class, + this.client.getContext()); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixInner> beginUpdateAsync( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, ipPrefixName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IpPrefixInner.class, IpPrefixInner.class, context); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixInner> beginUpdate( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body) { + return this.beginUpdateAsync(resourceGroupName, ipPrefixName, body).getSyncPoller(); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixInner> beginUpdate( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, ipPrefixName, body, context).getSyncPoller(); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String ipPrefixName, IpPrefixPatch body) { + return beginUpdateAsync(resourceGroupName, ipPrefixName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, ipPrefixName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixInner update(String resourceGroupName, String ipPrefixName, IpPrefixPatch body) { + return updateAsync(resourceGroupName, ipPrefixName, body).block(); + } + + /** + * Updates the IP Prefix. + * + *

API to update certain properties of the IP Prefix resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param body IP Prefix 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 IPPrefix resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixInner update(String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context) { + return updateAsync(resourceGroupName, ipPrefixName, body, context).block(); + } + + /** + * Deletes the IP Prefix. + * + *

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

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

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

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

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

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

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

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

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

Implements IP Prefix DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ipPrefixName, Context context) { + deleteAsync(resourceGroupName, ipPrefixName, context).block(); + } + + /** + * List IpPrefixes by resource group. + * + *

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by resource group. + * + *

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by resource group. + * + *

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

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by resource group. + * + *

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

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

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by subscription. + * + *

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by subscription. + * + *

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

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes by subscription. + * + *

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

Implements IpPrefixes 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 IpPrefixes 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 IpPrefixes 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 IpPrefixes 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 IpPrefixes 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 IpPrefixes 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/IpPrefixesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesImpl.java new file mode 100644 index 0000000000000..5d66e5f9afe09 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/IpPrefixesImpl.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.IpPrefixesClient; +import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpPrefixInner; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixes; + +public final class IpPrefixesImpl implements IpPrefixes { + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixesImpl.class); + + private final IpPrefixesClient innerClient; + + private final com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager; + + public IpPrefixesImpl( + IpPrefixesClient innerClient, + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipPrefixName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipPrefixName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpPrefixImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IpPrefix getByResourceGroup(String resourceGroupName, String ipPrefixName) { + IpPrefixInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipPrefixName); + if (inner != null) { + return new IpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ipPrefixName) { + this.serviceClient().delete(resourceGroupName, ipPrefixName); + } + + public void delete(String resourceGroupName, String ipPrefixName, Context context) { + this.serviceClient().delete(resourceGroupName, ipPrefixName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpPrefixImpl(inner1, this.manager())); + } + + public IpPrefix 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 ipPrefixName = Utils.getValueFromIdByName(id, "ipPrefixes"); + if (ipPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipPrefixName, 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 ipPrefixName = Utils.getValueFromIdByName(id, "ipPrefixes"); + if (ipPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipPrefixName, 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 ipPrefixName = Utils.getValueFromIdByName(id, "ipPrefixes"); + if (ipPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixes'.", id))); + } + this.delete(resourceGroupName, ipPrefixName, 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 ipPrefixName = Utils.getValueFromIdByName(id, "ipPrefixes"); + if (ipPrefixName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipPrefixes'.", id))); + } + this.delete(resourceGroupName, ipPrefixName, context); + } + + private IpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager() { + return this.serviceManager; + } + + public IpPrefixImpl define(String name) { + return new IpPrefixImpl(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 0000000000000..04f0cb46b1d10 --- /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 0000000000000..f48d1b8f8a01a --- /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 0000000000000..775d7a7acfc52 --- /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 0000000000000..4ee2267a5a53f --- /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.AggregateRouteConfiguration; +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.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 AggregateRouteConfiguration 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( + AggregateRouteConfiguration 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 0000000000000..da683a853b650 --- /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 0000000000000..dcd77ae00b020 --- /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 0000000000000..834a09f4cbafc --- /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 0000000000000..3865f01df4a80 --- /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.DeviceInterfaceProperties; +import com.azure.resourcemanager.managednetworkfabric.models.DeviceLimits; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceSku; +import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties; +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 DeviceLimits 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 0000000000000..e0de1f54158d5 --- /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 0000000000000..21879aa9099a2 --- /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 0000000000000..1ef65d4f40708 --- /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 0000000000000..394ded5076c4a --- /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 0000000000000..862671dff595e --- /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.InfrastructureServices; +import com.azure.resourcemanager.managednetworkfabric.models.ManagedResourceGroupConfiguration; +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.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.WorkloadServices; +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 InfrastructureServices infrastructureServices() { + return this.innerModel().infrastructureServices(); + } + + public WorkloadServices workloadServices() { + return this.innerModel().workloadServices(); + } + + public ManagedResourceGroupConfiguration 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( + ManagedResourceGroupConfiguration 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 0000000000000..a2c58e55b2fd0 --- /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 0000000000000..d8e067b319ca0 --- /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 0000000000000..9b4cce569a353 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkFabricImpl.java @@ -0,0 +1,344 @@ +// Copyright (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.ManagementNetworkConfiguration; +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.ProvisioningState; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchableProperties; +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 TerminalServerConfiguration terminalServerConfiguration() { + return this.innerModel().terminalServerConfiguration(); + } + + public ManagementNetworkConfiguration 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(TerminalServerConfiguration terminalServerConfiguration) { + this.innerModel().withTerminalServerConfiguration(terminalServerConfiguration); + return this; + } + + public NetworkFabricImpl withManagementNetworkConfiguration( + ManagementNetworkConfiguration 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( + TerminalServerPatchableProperties 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 0000000000000..ab25c2ef49054 --- /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 0000000000000..ba9706b94a501 --- /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 0000000000000..2a319f52f688c --- /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 0000000000000..71b01910401bc --- /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 0000000000000..1540d87b9533c --- /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 0000000000000..bd6418ea581f0 --- /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 0000000000000..6409c7680fc6a --- /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 0000000000000..5ae57eb0f49cc --- /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 0000000000000..d6c2d6f4b3960 --- /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 0000000000000..6a93fc0334d23 --- /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.NetworkDeviceRoleProperties; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackRoleName; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkRackSku; +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 0000000000000..1ea3284d081d9 --- /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 0000000000000..76289bdbfe08a --- /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 0000000000000..708d569561a05 --- /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 0000000000000..e10a66f720436 --- /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 0000000000000..08fe64463a779 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/NetworkToNetworkInterconnectImpl.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.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.Layer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NetworkToNetworkInterconnect; +import com.azure.resourcemanager.managednetworkfabric.models.NniType; +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 NniType nniType() { + return this.innerModel().nniType(); + } + + public EnabledDisabledState administrativeState() { + return this.innerModel().administrativeState(); + } + + public BooleanEnumProperty isManagementType() { + return this.innerModel().isManagementType(); + } + + public BooleanEnumProperty useOptionB() { + return this.innerModel().useOptionB(); + } + + public Layer2Configuration 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 withNniType(NniType nniType) { + this.innerModel().withNniType(nniType); + 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(Layer2Configuration 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 0000000000000..dd4b9c6140858 --- /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 0000000000000..cfb6b75c65915 --- /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 0000000000000..974ff8a640cb3 --- /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 0000000000000..6be169b6397b9 --- /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 0000000000000..58d3a20d0d5a8 --- /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 0000000000000..27934c6223c5b --- /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 0000000000000..6496774cd7fe6 --- /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 0000000000000..691495f2a1dcd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/RoutePolicyImpl.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.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.RoutePolicyStatementProperties; +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 List statements() { + List inner = this.innerModel().statements(); + 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 withStatements(List statements) { + this.innerModel().withStatements(statements); + return this; + } + + public RoutePolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public RoutePolicyImpl 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/SupportPackagePropertiesImpl.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/implementation/SupportPackagePropertiesImpl.java new file mode 100644 index 0000000000000..f2b8d11f48c58 --- /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 0000000000000..a637cb43f9a1d --- /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 0000000000000..26d9095c3d728 --- /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 0000000000000..aa7b586111726 --- /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 withConditions(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/AccessControlListConditionProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListConditionProperties.java new file mode 100644 index 0000000000000..f37fcec9e8354 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlListConditionProperties.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.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 AccessControlListConditionProperties 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 AccessControlListConditionProperties class. */ + public AccessControlListConditionProperties() { + } + + /** + * 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties 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 AccessControlListConditionProperties object itself. + */ + public AccessControlListConditionProperties withProtocol(int protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public AccessControlListConditionProperties 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 AccessControlListConditionProperties")); + } + if (destinationAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationAddress in model AccessControlListConditionProperties")); + } + if (destinationPort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model AccessControlListConditionProperties")); + } + if (sourceAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceAddress in model AccessControlListConditionProperties")); + } + if (sourcePort() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourcePort in model AccessControlListConditionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessControlListConditionProperties.class); +} 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 0000000000000..cabed0cc81c71 --- /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/AccessControlLists.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AccessControlLists.java new file mode 100644 index 0000000000000..c91c212cfd048 --- /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 0000000000000..10bfb3ae2d856 --- /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/ActionIpCommunityProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpCommunityProperties.java new file mode 100644 index 0000000000000..ca61949296925 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpCommunityProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** IP Community Properties. */ +@Fluent +public final class ActionIpCommunityProperties extends IpCommunityAddOperationProperties { + /* + * IP Community ID list properties. + */ + @JsonProperty(value = "delete") + private IpCommunityIdList delete; + + /* + * IP Community ID list properties. + */ + @JsonProperty(value = "set") + private IpCommunityIdList set; + + /** Creates an instance of ActionIpCommunityProperties class. */ + public ActionIpCommunityProperties() { + } + + /** + * Get the delete property: IP Community ID list properties. + * + * @return the delete value. + */ + public IpCommunityIdList delete() { + return this.delete; + } + + /** + * Set the delete property: IP Community ID list properties. + * + * @param delete the delete value to set. + * @return the ActionIpCommunityProperties object itself. + */ + public ActionIpCommunityProperties withDelete(IpCommunityIdList delete) { + this.delete = delete; + return this; + } + + /** + * Get the set property: IP Community ID list properties. + * + * @return the set value. + */ + public IpCommunityIdList set() { + return this.set; + } + + /** + * Set the set property: IP Community ID list properties. + * + * @param set the set value to set. + * @return the ActionIpCommunityProperties object itself. + */ + public ActionIpCommunityProperties withSet(IpCommunityIdList set) { + this.set = set; + return this; + } + + /** {@inheritDoc} */ + @Override + public ActionIpCommunityProperties withAdd(IpCommunityIdList add) { + super.withAdd(add); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (delete() != null) { + delete().validate(); + } + if (set() != null) { + set().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpExtendedCommunityProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpExtendedCommunityProperties.java new file mode 100644 index 0000000000000..6270249de9b28 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ActionIpExtendedCommunityProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** IP Extended Community Properties. */ +@Fluent +public final class ActionIpExtendedCommunityProperties extends IpExtendedCommunityAddOperationProperties { + /* + * IP Extended Community Id list properties. + */ + @JsonProperty(value = "delete") + private IpExtendedCommunityIdList delete; + + /* + * IP Extended Community Id list properties. + */ + @JsonProperty(value = "set") + private IpExtendedCommunityIdList set; + + /** Creates an instance of ActionIpExtendedCommunityProperties class. */ + public ActionIpExtendedCommunityProperties() { + } + + /** + * Get the delete property: IP Extended Community Id list properties. + * + * @return the delete value. + */ + public IpExtendedCommunityIdList delete() { + return this.delete; + } + + /** + * Set the delete property: IP Extended Community Id list properties. + * + * @param delete the delete value to set. + * @return the ActionIpExtendedCommunityProperties object itself. + */ + public ActionIpExtendedCommunityProperties withDelete(IpExtendedCommunityIdList delete) { + this.delete = delete; + return this; + } + + /** + * Get the set property: IP Extended Community Id list properties. + * + * @return the set value. + */ + public IpExtendedCommunityIdList set() { + return this.set; + } + + /** + * Set the set property: IP Extended Community Id list properties. + * + * @param set the set value to set. + * @return the ActionIpExtendedCommunityProperties object itself. + */ + public ActionIpExtendedCommunityProperties withSet(IpExtendedCommunityIdList set) { + this.set = set; + return this; + } + + /** {@inheritDoc} */ + @Override + public ActionIpExtendedCommunityProperties withAdd(IpExtendedCommunityIdList add) { + super.withAdd(add); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (delete() != null) { + delete().validate(); + } + if (set() != null) { + set().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 0000000000000..f52fb048ae539 --- /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 0000000000000..9ce88b1684ce0 --- /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 0000000000000..0f7bc4365b79c --- /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/AggregateRoute.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRoute.java new file mode 100644 index 0000000000000..3b90ab153e78b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRoute.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; + +/** Aggregate Route properties. */ +@Fluent +public final class AggregateRoute { + /* + * Prefix of the aggregate Route. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of AggregateRoute class. */ + public AggregateRoute() { + } + + /** + * Get the prefix property: Prefix of the aggregate Route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Prefix of the aggregate Route. + * + * @param prefix the prefix value to set. + * @return the AggregateRoute object itself. + */ + public AggregateRoute 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/AggregateRouteConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRouteConfiguration.java new file mode 100644 index 0000000000000..8b85d931be4f9 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AggregateRouteConfiguration.java @@ -0,0 +1,83 @@ +// Copyright (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 AggregateRouteConfiguration { + /* + * List of IPv4 Route prefixes. + */ + @JsonProperty(value = "ipv4Routes") + private List ipv4Routes; + + /* + * List of IPv6 Routes prefixes. + */ + @JsonProperty(value = "ipv6Routes") + private List ipv6Routes; + + /** Creates an instance of AggregateRouteConfiguration class. */ + public AggregateRouteConfiguration() { + } + + /** + * Get the ipv4Routes property: List of IPv4 Route prefixes. + * + * @return the ipv4Routes value. + */ + public List ipv4Routes() { + return this.ipv4Routes; + } + + /** + * Set the ipv4Routes property: List of IPv4 Route prefixes. + * + * @param ipv4Routes the ipv4Routes value to set. + * @return the AggregateRouteConfiguration object itself. + */ + public AggregateRouteConfiguration withIpv4Routes(List ipv4Routes) { + this.ipv4Routes = ipv4Routes; + return this; + } + + /** + * Get the ipv6Routes property: List of IPv6 Routes prefixes. + * + * @return the ipv6Routes value. + */ + public List ipv6Routes() { + return this.ipv6Routes; + } + + /** + * Set the ipv6Routes property: List of IPv6 Routes prefixes. + * + * @param ipv6Routes the ipv6Routes value to set. + * @return the AggregateRouteConfiguration object itself. + */ + public AggregateRouteConfiguration 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/AllowASOverride.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/AllowASOverride.java new file mode 100644 index 0000000000000..4a753704781d7 --- /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 0000000000000..0bc7c1be4f3ae --- /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 0000000000000..2ebcca3f52d07 --- /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 0000000000000..3fdbc2e8e5376 --- /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/BgpConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BgpConfiguration.java new file mode 100644 index 0000000000000..e68f3081562e5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BgpConfiguration.java @@ -0,0 +1,295 @@ +// Copyright (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 BgpConfiguration 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 IPv6 Neighbor Address. + */ + @JsonProperty(value = "ipv6NeighborAddress") + private List ipv6NeighborAddress; + + /** Creates an instance of BgpConfiguration class. */ + public BgpConfiguration() { + } + + /** + * 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration 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 BgpConfiguration object itself. + */ + public BgpConfiguration withIpv4NeighborAddress(List ipv4NeighborAddress) { + this.ipv4NeighborAddress = ipv4NeighborAddress; + return this; + } + + /** + * Get the ipv6NeighborAddress property: List with stringified IPv6 Neighbor Address. + * + * @return the ipv6NeighborAddress value. + */ + public List ipv6NeighborAddress() { + return this.ipv6NeighborAddress; + } + + /** + * Set the ipv6NeighborAddress property: List with stringified IPv6 Neighbor Address. + * + * @param ipv6NeighborAddress the ipv6NeighborAddress value to set. + * @return the BgpConfiguration object itself. + */ + public BgpConfiguration withIpv6NeighborAddress(List ipv6NeighborAddress) { + this.ipv6NeighborAddress = ipv6NeighborAddress; + return this; + } + + /** {@inheritDoc} */ + @Override + public BgpConfiguration 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/BooleanEnumProperty.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/BooleanEnumProperty.java new file mode 100644 index 0000000000000..ee0306982d17b --- /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/CommunityActionTypes.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionTypes.java new file mode 100644 index 0000000000000..693807fb3fc72 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/CommunityActionTypes.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; + +/** community action types. Example: Permit | Deny. */ +public final class CommunityActionTypes extends ExpandableStringEnum { + /** Static value Permit for CommunityActionTypes. */ + public static final CommunityActionTypes PERMIT = fromString("Permit"); + + /** Static value Deny for CommunityActionTypes. */ + public static final CommunityActionTypes DENY = fromString("Deny"); + + /** + * Creates a new instance of CommunityActionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommunityActionTypes() { + } + + /** + * Creates or finds a CommunityActionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommunityActionTypes. + */ + @JsonCreator + public static CommunityActionTypes fromString(String name) { + return fromString(name, CommunityActionTypes.class); + } + + /** + * Gets known CommunityActionTypes values. + * + * @return known CommunityActionTypes values. + */ + public static Collection values() { + return values(CommunityActionTypes.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Condition.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Condition.java new file mode 100644 index 0000000000000..a4ebf389e9b42 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Condition.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; + +/** Specify prefix-list bounds. */ +public final class Condition extends ExpandableStringEnum { + /** Static value EqualTo for Condition. */ + public static final Condition EQUAL_TO = fromString("EqualTo"); + + /** Static value GreaterThanOrEqualTo for Condition. */ + public static final Condition GREATER_THAN_OR_EQUAL_TO = fromString("GreaterThanOrEqualTo"); + + /** Static value LesserThanOrEqualTo for Condition. */ + public static final Condition LESSER_THAN_OR_EQUAL_TO = fromString("LesserThanOrEqualTo"); + + /** + * Creates a new instance of Condition value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Condition() { + } + + /** + * Creates or finds a Condition from its string representation. + * + * @param name a name to look for. + * @return the corresponding Condition. + */ + @JsonCreator + public static Condition fromString(String name) { + return fromString(name, Condition.class); + } + + /** + * Gets known Condition values. + * + * @return known Condition values. + */ + public static Collection values() { + return values(Condition.class); + } +} 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 0000000000000..bfd3b6d8f8b81 --- /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/ConnectedSubnet.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConnectedSubnet.java new file mode 100644 index 0000000000000..0132eed0d2e0a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ConnectedSubnet.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; + +/** Connected Subnet properties. */ +@Fluent +public final class ConnectedSubnet extends AnnotationResource { + /* + * Prefix of the connected Subnet. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /** Creates an instance of ConnectedSubnet class. */ + public ConnectedSubnet() { + } + + /** + * Get the prefix property: Prefix of the connected Subnet. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Prefix of the connected Subnet. + * + * @param prefix the prefix value to set. + * @return the ConnectedSubnet object itself. + */ + public ConnectedSubnet withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectedSubnet 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/DeviceInterfaceProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceInterfaceProperties.java new file mode 100644 index 0000000000000..03ccb7b92d718 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceInterfaceProperties.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 DeviceInterfaceProperties { + /* + * 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 DeviceInterfaceProperties class. */ + public DeviceInterfaceProperties() { + } + + /** + * 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 DeviceInterfaceProperties object itself. + */ + public DeviceInterfaceProperties 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 DeviceInterfaceProperties object itself. + */ + public DeviceInterfaceProperties 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 DeviceInterfaceProperties object itself. + */ + public DeviceInterfaceProperties 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/DeviceLimits.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceLimits.java new file mode 100644 index 0000000000000..9e9239655459c --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/DeviceLimits.java @@ -0,0 +1,182 @@ +// Copyright (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 DeviceLimits { + /* + * 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 DeviceLimits class. */ + public DeviceLimits() { + } + + /** + * 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 DeviceLimits object itself. + */ + public DeviceLimits 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 DeviceLimits object itself. + */ + public DeviceLimits 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 DeviceLimits object itself. + */ + public DeviceLimits 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 DeviceLimits object itself. + */ + public DeviceLimits 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 DeviceLimits object itself. + */ + public DeviceLimits 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 DeviceLimits object itself. + */ + public DeviceLimits 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/EnableDisableOnResources.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/EnableDisableOnResources.java new file mode 100644 index 0000000000000..bbb8882d691d4 --- /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 0000000000000..7740d960e2eb3 --- /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/ExpressRouteConnectionInformation.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ExpressRouteConnectionInformation.java new file mode 100644 index 0000000000000..57e2524111078 --- /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 0000000000000..52665c02888ba --- /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(Layer3OptionAProperties 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 0000000000000..63b5e8ae3947e --- /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 Layer3OptionAProperties 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(Layer3OptionAProperties 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 0000000000000..47f2f910bac46 --- /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 Layer3OptionAProperties 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 Layer3OptionAProperties 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(Layer3OptionAProperties 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 0000000000000..e13d34da492e9 --- /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 Layer3OptionAProperties { + /** 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 0000000000000..86531b09ef27d --- /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 0000000000000..b39c73626dcac --- /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/FabricBfdConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/FabricBfdConfiguration.java new file mode 100644 index 0000000000000..7fc7d8830e0ed --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/FabricBfdConfiguration.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 FabricBfdConfiguration { + /* + * 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 FabricBfdConfiguration class. */ + public FabricBfdConfiguration() { + } + + /** + * 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/GetDeviceStatusProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/GetDeviceStatusProperties.java new file mode 100644 index 0000000000000..b6e8ee4f57fe9 --- /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 0000000000000..ce8d585373834 --- /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 0000000000000..8b1a06e857f4d --- /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/InfrastructureServices.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InfrastructureServices.java new file mode 100644 index 0000000000000..66241ca1f1e57 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InfrastructureServices.java @@ -0,0 +1,82 @@ +// Copyright (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 InfrastructureServices { + /* + * 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 InfrastructureServices class. */ + public InfrastructureServices() { + } + + /** + * 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 InfrastructureServices object itself. + */ + public InfrastructureServices 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 InfrastructureServices object itself. + */ + public InfrastructureServices 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/InterfaceStatus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InterfaceStatus.java new file mode 100644 index 0000000000000..62e6f3062f31f --- /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 0000000000000..3ec53f63efa21 --- /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 0000000000000..7f8babe99dd8d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetwork.java @@ -0,0 +1,586 @@ +// Copyright (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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + List connectedIPv4Subnets(); + + /** + * Gets the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + List connectedIPv6Subnets(); + + /** + * Gets the staticRouteConfiguration property: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + StaticRouteConfiguration staticRouteConfiguration(); + + /** + * Gets the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + BgpConfiguration 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 connected IPv4 Subnets.. + * + * @param connectedIPv4Subnets List with object connected IPv4 Subnets. + * @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 connected IPv6 Subnets.. + * + * @param connectedIPv6Subnets List with object connected IPv6 Subnets. + * @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: Static Route Configuration properties.. + * + * @param staticRouteConfiguration Static Route Configuration properties. + * @return the next definition stage. + */ + WithCreate withStaticRouteConfiguration(StaticRouteConfiguration 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(BgpConfiguration 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 connected IPv4 Subnets.. + * + * @param connectedIPv4Subnets List with object connected IPv4 Subnets. + * @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 connected IPv6 Subnets.. + * + * @param connectedIPv6Subnets List with object connected IPv6 Subnets. + * @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: Static Route Configuration properties.. + * + * @param staticRouteConfiguration Static Route Configuration properties. + * @return the next definition stage. + */ + Update withStaticRouteConfiguration(StaticRouteConfiguration 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(BgpConfiguration 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 0000000000000..324eba38796e6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatch.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.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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv4Subnets(); + } + + /** + * Set the connectedIPv4Subnets property: List with object connected IPv4 Subnets. + * + * @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 connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.innerProperties() == null ? null : this.innerProperties().connectedIPv6Subnets(); + } + + /** + * Set the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @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: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + public StaticRouteConfiguration staticRouteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().staticRouteConfiguration(); + } + + /** + * Set the staticRouteConfiguration property: Static Route Configuration properties. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatch object itself. + */ + public InternalNetworkPatch withStaticRouteConfiguration(StaticRouteConfiguration 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 BgpConfiguration 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(BgpConfiguration 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 0000000000000..805da8edff5da --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworkPatchableProperties.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.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 connected IPv4 Subnets. + */ + @JsonProperty(value = "connectedIPv4Subnets") + private List connectedIPv4Subnets; + + /* + * List with object connected IPv6 Subnets. + */ + @JsonProperty(value = "connectedIPv6Subnets") + private List connectedIPv6Subnets; + + /* + * Static Route Configuration properties. + */ + @JsonProperty(value = "staticRouteConfiguration") + private StaticRouteConfiguration staticRouteConfiguration; + + /* + * BGP configuration properties + */ + @JsonProperty(value = "bgpConfiguration") + private BgpConfiguration 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 connected IPv4 Subnets. + * + * @return the connectedIPv4Subnets value. + */ + public List connectedIPv4Subnets() { + return this.connectedIPv4Subnets; + } + + /** + * Set the connectedIPv4Subnets property: List with object connected IPv4 Subnets. + * + * @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 connected IPv6 Subnets. + * + * @return the connectedIPv6Subnets value. + */ + public List connectedIPv6Subnets() { + return this.connectedIPv6Subnets; + } + + /** + * Set the connectedIPv6Subnets property: List with object connected IPv6 Subnets. + * + * @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: Static Route Configuration properties. + * + * @return the staticRouteConfiguration value. + */ + public StaticRouteConfiguration staticRouteConfiguration() { + return this.staticRouteConfiguration; + } + + /** + * Set the staticRouteConfiguration property: Static Route Configuration properties. + * + * @param staticRouteConfiguration the staticRouteConfiguration value to set. + * @return the InternalNetworkPatchableProperties object itself. + */ + public InternalNetworkPatchableProperties withStaticRouteConfiguration( + StaticRouteConfiguration staticRouteConfiguration) { + this.staticRouteConfiguration = staticRouteConfiguration; + return this; + } + + /** + * Get the bgpConfiguration property: BGP configuration properties. + * + * @return the bgpConfiguration value. + */ + public BgpConfiguration 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(BgpConfiguration 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/InternalNetworks.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/InternalNetworks.java new file mode 100644 index 0000000000000..448f78124bd32 --- /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 0000000000000..e241965f5d643 --- /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/IpCommunities.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunities.java new file mode 100644 index 0000000000000..264ad43f4900b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunities.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 IpCommunities. */ +public interface IpCommunities { + /** + * Gets an IP Community. + * + *

Implements an IP Community GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunity resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipCommunityName, Context context); + + /** + * Gets an IP Community. + * + *

Implements an IP Community GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpCommunity resource definition. + */ + IpCommunity getByResourceGroup(String resourceGroupName, String ipCommunityName); + + /** + * Deletes an IP Community. + * + *

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

Implements IP Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipCommunityName Name of the IP Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipCommunityName, Context context); + + /** + * List IpCommunities by resource group. + * + *

Implements IpCommunities 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 IPCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpCommunities by resource group. + * + *

Implements IpCommunities 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 IPCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpCommunities by subscription. + * + *

Implements IpCommunities 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 IPCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IpCommunities by subscription. + * + *

Implements IpCommunities 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 IPCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets an IP Community. + * + *

Implements an IP Community 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 IpCommunity resource definition along with {@link Response}. + */ + IpCommunity getById(String id); + + /** + * Gets an IP Community. + * + *

Implements an IP Community 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 IpCommunity resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an IP Community. + * + *

Implements IP Community 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 an IP Community. + * + *

Implements IP Community 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 IpCommunity resource. + * + * @param name resource name. + * @return the first stage of the new IpCommunity definition. + */ + IpCommunity.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitiesListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitiesListResult.java new file mode 100644 index 0000000000000..d2aab00a32ad8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitiesListResult.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.IpCommunityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IPCommunities. */ +@Fluent +public final class IpCommunitiesListResult { + /* + * List of IpCommunity 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 IpCommunitiesListResult class. */ + public IpCommunitiesListResult() { + } + + /** + * Get the value property: List of IpCommunity resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IpCommunity resources. + * + * @param value the value value to set. + * @return the IpCommunitiesListResult object itself. + */ + public IpCommunitiesListResult 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 IpCommunitiesListResult object itself. + */ + public IpCommunitiesListResult 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/IpCommunity.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunity.java new file mode 100644 index 0000000000000..28e5fc6b54da6 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunity.java @@ -0,0 +1,288 @@ +// Copyright (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.IpCommunityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpCommunity. */ +public interface IpCommunity { + /** + * 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 to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + CommunityActionTypes action(); + + /** + * Gets the wellKnownCommunities property: Supported well known Community List. + * + * @return the wellKnownCommunities value. + */ + List wellKnownCommunities(); + + /** + * Gets the communityMembers property: List the communityMembers of IP Community . + * + * @return the communityMembers value. + */ + List communityMembers(); + + /** + * 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.IpCommunityInner object. + * + * @return the inner object. + */ + IpCommunityInner innerModel(); + + /** The entirety of the IpCommunity definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpCommunity definition stages. */ + interface DefinitionStages { + /** The first stage of the IpCommunity definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpCommunity 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 IpCommunity 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 IpCommunity 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.WithWellKnownCommunities, + DefinitionStages.WithCommunityMembers, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpCommunity create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpCommunity create(Context context); + } + /** The stage of the IpCommunity 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 IpCommunity definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Action to be taken on the configuration. Example: Permit | Deny.. + * + * @param action Action to be taken on the configuration. Example: Permit | Deny. + * @return the next definition stage. + */ + WithCreate withAction(CommunityActionTypes action); + } + /** The stage of the IpCommunity definition allowing to specify wellKnownCommunities. */ + interface WithWellKnownCommunities { + /** + * Specifies the wellKnownCommunities property: Supported well known Community List.. + * + * @param wellKnownCommunities Supported well known Community List. + * @return the next definition stage. + */ + WithCreate withWellKnownCommunities(List wellKnownCommunities); + } + /** The stage of the IpCommunity definition allowing to specify communityMembers. */ + interface WithCommunityMembers { + /** + * Specifies the communityMembers property: List the communityMembers of IP Community .. + * + * @param communityMembers List the communityMembers of IP Community . + * @return the next definition stage. + */ + WithCreate withCommunityMembers(List communityMembers); + } + /** The stage of the IpCommunity 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 IpCommunity resource. + * + * @return the stage of resource update. + */ + IpCommunity.Update update(); + + /** The template for IpCommunity update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpCommunity apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpCommunity apply(Context context); + } + /** The IpCommunity update stages. */ + interface UpdateStages { + /** The stage of the IpCommunity update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpCommunity refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpCommunity refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityAddOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityAddOperationProperties.java new file mode 100644 index 0000000000000..b1cb9edc72660 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityAddOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Community add operation properties. */ +@Fluent +public class IpCommunityAddOperationProperties { + /* + * IP Community ID list properties. + */ + @JsonProperty(value = "add") + private IpCommunityIdList add; + + /** Creates an instance of IpCommunityAddOperationProperties class. */ + public IpCommunityAddOperationProperties() { + } + + /** + * Get the add property: IP Community ID list properties. + * + * @return the add value. + */ + public IpCommunityIdList add() { + return this.add; + } + + /** + * Set the add property: IP Community ID list properties. + * + * @param add the add value to set. + * @return the IpCommunityAddOperationProperties object itself. + */ + public IpCommunityAddOperationProperties withAdd(IpCommunityIdList add) { + this.add = add; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (add() != null) { + add().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityDeleteOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityDeleteOperationProperties.java new file mode 100644 index 0000000000000..bf3bdd123249e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityDeleteOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Community delete operation properties. */ +@Fluent +public class IpCommunityDeleteOperationProperties { + /* + * IP Community ID list properties. + */ + @JsonProperty(value = "delete") + private IpCommunityIdList delete; + + /** Creates an instance of IpCommunityDeleteOperationProperties class. */ + public IpCommunityDeleteOperationProperties() { + } + + /** + * Get the delete property: IP Community ID list properties. + * + * @return the delete value. + */ + public IpCommunityIdList delete() { + return this.delete; + } + + /** + * Set the delete property: IP Community ID list properties. + * + * @param delete the delete value to set. + * @return the IpCommunityDeleteOperationProperties object itself. + */ + public IpCommunityDeleteOperationProperties withDelete(IpCommunityIdList delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (delete() != null) { + delete().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityIdList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityIdList.java new file mode 100644 index 0000000000000..87e9cef54aa5d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityIdList.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; + +/** IP Community ID list properties. */ +@Fluent +public class IpCommunityIdList { + /* + * List of IP Community resource IDs. + */ + @JsonProperty(value = "ipCommunityIds") + private List ipCommunityIds; + + /** Creates an instance of IpCommunityIdList class. */ + public IpCommunityIdList() { + } + + /** + * Get the ipCommunityIds property: List of IP Community resource IDs. + * + * @return the ipCommunityIds value. + */ + public List ipCommunityIds() { + return this.ipCommunityIds; + } + + /** + * Set the ipCommunityIds property: List of IP Community resource IDs. + * + * @param ipCommunityIds the ipCommunityIds value to set. + * @return the IpCommunityIdList object itself. + */ + public IpCommunityIdList withIpCommunityIds(List ipCommunityIds) { + this.ipCommunityIds = ipCommunityIds; + 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/IpCommunityPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityPatch.java new file mode 100644 index 0000000000000..da61a769cb810 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunityPatch.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IPCommunity patch resource definition. */ +@Fluent +public final class IpCommunityPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of IpCommunityPatch class. */ + public IpCommunityPatch() { + } + + /** + * 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 IpCommunityPatch object itself. + */ + public IpCommunityPatch 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/IpCommunitySetOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitySetOperationProperties.java new file mode 100644 index 0000000000000..2946278717817 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpCommunitySetOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Community set operation properties. */ +@Fluent +public class IpCommunitySetOperationProperties { + /* + * IP Community ID list properties. + */ + @JsonProperty(value = "set") + private IpCommunityIdList set; + + /** Creates an instance of IpCommunitySetOperationProperties class. */ + public IpCommunitySetOperationProperties() { + } + + /** + * Get the set property: IP Community ID list properties. + * + * @return the set value. + */ + public IpCommunityIdList set() { + return this.set; + } + + /** + * Set the set property: IP Community ID list properties. + * + * @param set the set value to set. + * @return the IpCommunitySetOperationProperties object itself. + */ + public IpCommunitySetOperationProperties withSet(IpCommunityIdList 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/IpExtendedCommunities.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunities.java new file mode 100644 index 0000000000000..061b14953bd2f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunities.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 IpExtendedCommunities. */ +public interface IpExtendedCommunities { + /** + * Gets an IP Extended Community. + * + *

Implements IP Extended Community GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpExtendedCommunity resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipExtendedCommunityName, Context context); + + /** + * Gets an IP Extended Community. + * + *

Implements IP Extended Community GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpExtendedCommunity resource definition. + */ + IpExtendedCommunity getByResourceGroup(String resourceGroupName, String ipExtendedCommunityName); + + /** + * Deletes the IP Extended Community. + * + *

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

Implements IP Extended Community DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipExtendedCommunityName Name of the IP Extended Community. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipExtendedCommunityName, Context context); + + /** + * List IpExtendedCommunities by resource group. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpExtendedCommunities by resource group. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpExtendedCommunities by subscription. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IpExtendedCommunities by subscription. + * + *

Implements IpExtendedCommunities 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 IpExtendedCommunities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets an IP Extended Community. + * + *

Implements IP Extended Community 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 IpExtendedCommunity resource definition along with {@link Response}. + */ + IpExtendedCommunity getById(String id); + + /** + * Gets an IP Extended Community. + * + *

Implements IP Extended Community 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 IpExtendedCommunity resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the IP Extended Community. + * + *

Implements IP Extended Community 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 the IP Extended Community. + * + *

Implements IP Extended Community 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 IpExtendedCommunity resource. + * + * @param name resource name. + * @return the first stage of the new IpExtendedCommunity definition. + */ + IpExtendedCommunity.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunity.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunity.java new file mode 100644 index 0000000000000..573179715ebda --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunity.java @@ -0,0 +1,278 @@ +// Copyright (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.IpExtendedCommunityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpExtendedCommunity. */ +public interface IpExtendedCommunity { + /** + * 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 to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + CommunityActionTypes action(); + + /** + * Gets the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example 10.10.10.10:65535. The + * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295. + * + * @return the routeTargets value. + */ + List routeTargets(); + + /** + * 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.IpExtendedCommunityInner object. + * + * @return the inner object. + */ + IpExtendedCommunityInner innerModel(); + + /** The entirety of the IpExtendedCommunity definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpExtendedCommunity definition stages. */ + interface DefinitionStages { + /** The first stage of the IpExtendedCommunity definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpExtendedCommunity 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 IpExtendedCommunity 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 IpExtendedCommunity 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.WithRouteTargets, + DefinitionStages.WithAnnotation { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpExtendedCommunity create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpExtendedCommunity create(Context context); + } + /** The stage of the IpExtendedCommunity 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 IpExtendedCommunity definition allowing to specify action. */ + interface WithAction { + /** + * Specifies the action property: Action to be taken on the configuration. Example: Permit | Deny.. + * + * @param action Action to be taken on the configuration. Example: Permit | Deny. + * @return the next definition stage. + */ + WithCreate withAction(CommunityActionTypes action); + } + /** The stage of the IpExtendedCommunity definition allowing to specify routeTargets. */ + interface WithRouteTargets { + /** + * Specifies the routeTargets property: Route Target List.The expected formats are ASN(plain):NN >> + * example 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example + * 10.10.10.10:65535. The possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of + * 0-4294967295.. + * + * @param routeTargets Route Target List.The expected formats are ASN(plain):NN >> example + * 4294967294:50, ASN.ASN:NN >> example 65533.65333:40, IP-address:NN >> example + * 10.10.10.10:65535. The possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of + * 0-4294967295. + * @return the next definition stage. + */ + WithCreate withRouteTargets(List routeTargets); + } + /** The stage of the IpExtendedCommunity 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 IpExtendedCommunity resource. + * + * @return the stage of resource update. + */ + IpExtendedCommunity.Update update(); + + /** The template for IpExtendedCommunity update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpExtendedCommunity apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpExtendedCommunity apply(Context context); + } + /** The IpExtendedCommunity update stages. */ + interface UpdateStages { + /** The stage of the IpExtendedCommunity update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpExtendedCommunity refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpExtendedCommunity refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityAddOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityAddOperationProperties.java new file mode 100644 index 0000000000000..3c173546ed330 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityAddOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Extended Community add operation properties. */ +@Fluent +public class IpExtendedCommunityAddOperationProperties { + /* + * IP Extended Community Id list properties. + */ + @JsonProperty(value = "add") + private IpExtendedCommunityIdList add; + + /** Creates an instance of IpExtendedCommunityAddOperationProperties class. */ + public IpExtendedCommunityAddOperationProperties() { + } + + /** + * Get the add property: IP Extended Community Id list properties. + * + * @return the add value. + */ + public IpExtendedCommunityIdList add() { + return this.add; + } + + /** + * Set the add property: IP Extended Community Id list properties. + * + * @param add the add value to set. + * @return the IpExtendedCommunityAddOperationProperties object itself. + */ + public IpExtendedCommunityAddOperationProperties withAdd(IpExtendedCommunityIdList add) { + this.add = add; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (add() != null) { + add().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityDeleteOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityDeleteOperationProperties.java new file mode 100644 index 0000000000000..f01b1c7846a43 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityDeleteOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Extended Community delete operation properties. */ +@Fluent +public class IpExtendedCommunityDeleteOperationProperties { + /* + * IP Extended Community Id list properties. + */ + @JsonProperty(value = "delete") + private IpExtendedCommunityIdList delete; + + /** Creates an instance of IpExtendedCommunityDeleteOperationProperties class. */ + public IpExtendedCommunityDeleteOperationProperties() { + } + + /** + * Get the delete property: IP Extended Community Id list properties. + * + * @return the delete value. + */ + public IpExtendedCommunityIdList delete() { + return this.delete; + } + + /** + * Set the delete property: IP Extended Community Id list properties. + * + * @param delete the delete value to set. + * @return the IpExtendedCommunityDeleteOperationProperties object itself. + */ + public IpExtendedCommunityDeleteOperationProperties withDelete(IpExtendedCommunityIdList delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (delete() != null) { + delete().validate(); + } + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityIdList.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityIdList.java new file mode 100644 index 0000000000000..131141a2dcab1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityIdList.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; + +/** IP Extended Community Id list properties. */ +@Fluent +public class IpExtendedCommunityIdList { + /* + * List of IP Extended Community resource IDs. + */ + @JsonProperty(value = "ipExtendedCommunityIds") + private List ipExtendedCommunityIds; + + /** Creates an instance of IpExtendedCommunityIdList class. */ + public IpExtendedCommunityIdList() { + } + + /** + * Get the ipExtendedCommunityIds property: List of IP Extended Community resource IDs. + * + * @return the ipExtendedCommunityIds value. + */ + public List ipExtendedCommunityIds() { + return this.ipExtendedCommunityIds; + } + + /** + * Set the ipExtendedCommunityIds property: List of IP Extended Community resource IDs. + * + * @param ipExtendedCommunityIds the ipExtendedCommunityIds value to set. + * @return the IpExtendedCommunityIdList object itself. + */ + public IpExtendedCommunityIdList withIpExtendedCommunityIds(List ipExtendedCommunityIds) { + this.ipExtendedCommunityIds = ipExtendedCommunityIds; + 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/IpExtendedCommunityListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityListResult.java new file mode 100644 index 0000000000000..8c60441eac1ee --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityListResult.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.IpExtendedCommunityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IpExtendedCommunities. */ +@Fluent +public final class IpExtendedCommunityListResult { + /* + * List of IpExtendedCommunities 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 IpExtendedCommunityListResult class. */ + public IpExtendedCommunityListResult() { + } + + /** + * Get the value property: List of IpExtendedCommunities resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IpExtendedCommunities resources. + * + * @param value the value value to set. + * @return the IpExtendedCommunityListResult object itself. + */ + public IpExtendedCommunityListResult 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 IpExtendedCommunityListResult object itself. + */ + public IpExtendedCommunityListResult 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/IpExtendedCommunityPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityPatch.java new file mode 100644 index 0000000000000..6b5faccd471dd --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunityPatch.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IpExtendedCommunities patch resource definition. */ +@Fluent +public final class IpExtendedCommunityPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of IpExtendedCommunityPatch class. */ + public IpExtendedCommunityPatch() { + } + + /** + * 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 IpExtendedCommunityPatch object itself. + */ + public IpExtendedCommunityPatch 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/IpExtendedCommunitySetOperationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunitySetOperationProperties.java new file mode 100644 index 0000000000000..8440fde7301b5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpExtendedCommunitySetOperationProperties.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Extended Community set operation properties. */ +@Fluent +public class IpExtendedCommunitySetOperationProperties { + /* + * IP Extended Community Id list properties. + */ + @JsonProperty(value = "set") + private IpExtendedCommunityIdList set; + + /** Creates an instance of IpExtendedCommunitySetOperationProperties class. */ + public IpExtendedCommunitySetOperationProperties() { + } + + /** + * Get the set property: IP Extended Community Id list properties. + * + * @return the set value. + */ + public IpExtendedCommunityIdList set() { + return this.set; + } + + /** + * Set the set property: IP Extended Community Id list properties. + * + * @param set the set value to set. + * @return the IpExtendedCommunitySetOperationProperties object itself. + */ + public IpExtendedCommunitySetOperationProperties withSet(IpExtendedCommunityIdList 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/IpPrefix.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefix.java new file mode 100644 index 0000000000000..9fcdf8903929b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefix.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.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.IpPrefixInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpPrefix. */ +public interface IpPrefix { + /** + * 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 ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects. + * + * @return the ipPrefixRules value. + */ + List ipPrefixRules(); + + /** + * 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.IpPrefixInner object. + * + * @return the inner object. + */ + IpPrefixInner innerModel(); + + /** The entirety of the IpPrefix definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithIpPrefixRules, + DefinitionStages.WithCreate { + } + /** The IpPrefix definition stages. */ + interface DefinitionStages { + /** The first stage of the IpPrefix definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpPrefix 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 IpPrefix 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. + */ + WithIpPrefixRules withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the IpPrefix definition allowing to specify ipPrefixRules. */ + interface WithIpPrefixRules { + /** + * Specifies the ipPrefixRules property: IpPrefix contains the list of IP PrefixRules objects.. + * + * @param ipPrefixRules IpPrefix contains the list of IP PrefixRules objects. + * @return the next definition stage. + */ + WithCreate withIpPrefixRules(List ipPrefixRules); + } + /** + * The stage of the IpPrefix 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. + */ + IpPrefix create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpPrefix create(Context context); + } + /** The stage of the IpPrefix 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 IpPrefix 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 IpPrefix resource. + * + * @return the stage of resource update. + */ + IpPrefix.Update update(); + + /** The template for IpPrefix update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpPrefix apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpPrefix apply(Context context); + } + /** The IpPrefix update stages. */ + interface UpdateStages { + /** The stage of the IpPrefix update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpPrefix refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpPrefix refresh(Context context); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPatch.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPatch.java new file mode 100644 index 0000000000000..ab8744631f5ef --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPatch.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IPPrefix patch resource definition. */ +@Fluent +public final class IpPrefixPatch { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of IpPrefixPatch class. */ + public IpPrefixPatch() { + } + + /** + * 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 IpPrefixPatch object itself. + */ + public IpPrefixPatch 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/IpPrefixPropertiesIpPrefixRulesItem.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPropertiesIpPrefixRulesItem.java new file mode 100644 index 0000000000000..1d90b9ccc44b0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixPropertiesIpPrefixRulesItem.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IpPrefixPropertiesIpPrefixRulesItem model. */ +@Fluent +public final class IpPrefixPropertiesIpPrefixRulesItem { + /* + * Action to be taken on the configuration. Example: Permit | Deny. + */ + @JsonProperty(value = "action", required = true) + private CommunityActionTypes action; + + /* + * Sequence to insert to/delete from existing route. Prefix lists are evaluated starting with the lowest sequence + * number and continue down the list until a match is made. Once a match is made, the permit or deny statement is + * applied to that network and the rest of the list is ignored. + */ + @JsonProperty(value = "sequenceNumber", required = true) + private long sequenceNumber; + + /* + * Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: 1.1.1.0/24 | + * 3FFE:FFFF:0:CD30::/126 + */ + @JsonProperty(value = "networkPrefix", required = true) + private String networkPrefix; + + /* + * Specify prefix-list bounds. + */ + @JsonProperty(value = "condition") + private Condition condition; + + /* + * SubnetMaskLength gives the minimum NetworkPrefix length to be matched.Possible values for IPv4 are 1 - 32. + * Possible values of IPv6 are 1 - 128. + */ + @JsonProperty(value = "subnetMaskLength") + private Integer subnetMaskLength; + + /** Creates an instance of IpPrefixPropertiesIpPrefixRulesItem class. */ + public IpPrefixPropertiesIpPrefixRulesItem() { + } + + /** + * Get the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @return the action value. + */ + public CommunityActionTypes action() { + return this.action; + } + + /** + * Set the action property: Action to be taken on the configuration. Example: Permit | Deny. + * + * @param action the action value to set. + * @return the IpPrefixPropertiesIpPrefixRulesItem object itself. + */ + public IpPrefixPropertiesIpPrefixRulesItem withAction(CommunityActionTypes action) { + this.action = action; + return this; + } + + /** + * Get the sequenceNumber property: Sequence to insert to/delete from existing route. Prefix lists are evaluated + * starting with the lowest sequence number and continue down the list until a match is made. Once a match is made, + * the permit or deny statement is applied to that network and the rest of the list is ignored. + * + * @return the sequenceNumber value. + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: Sequence to insert to/delete from existing route. Prefix lists are evaluated + * starting with the lowest sequence number and continue down the list until a match is made. Once a match is made, + * the permit or deny statement is applied to that network and the rest of the list is ignored. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the IpPrefixPropertiesIpPrefixRulesItem object itself. + */ + public IpPrefixPropertiesIpPrefixRulesItem withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the networkPrefix property: Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: + * 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126. + * + * @return the networkPrefix value. + */ + public String networkPrefix() { + return this.networkPrefix; + } + + /** + * Set the networkPrefix property: Network Prefix specifying IPv4/IPv6 packets to be permitted or denied. Example: + * 1.1.1.0/24 | 3FFE:FFFF:0:CD30::/126. + * + * @param networkPrefix the networkPrefix value to set. + * @return the IpPrefixPropertiesIpPrefixRulesItem object itself. + */ + public IpPrefixPropertiesIpPrefixRulesItem withNetworkPrefix(String networkPrefix) { + this.networkPrefix = networkPrefix; + return this; + } + + /** + * Get the condition property: Specify prefix-list bounds. + * + * @return the condition value. + */ + public Condition condition() { + return this.condition; + } + + /** + * Set the condition property: Specify prefix-list bounds. + * + * @param condition the condition value to set. + * @return the IpPrefixPropertiesIpPrefixRulesItem object itself. + */ + public IpPrefixPropertiesIpPrefixRulesItem withCondition(Condition condition) { + this.condition = condition; + return this; + } + + /** + * Get the subnetMaskLength property: SubnetMaskLength gives the minimum NetworkPrefix length to be matched.Possible + * values for IPv4 are 1 - 32. Possible values of IPv6 are 1 - 128. + * + * @return the subnetMaskLength value. + */ + public Integer subnetMaskLength() { + return this.subnetMaskLength; + } + + /** + * Set the subnetMaskLength property: SubnetMaskLength gives the minimum NetworkPrefix length to be matched.Possible + * values for IPv4 are 1 - 32. Possible values of IPv6 are 1 - 128. + * + * @param subnetMaskLength the subnetMaskLength value to set. + * @return the IpPrefixPropertiesIpPrefixRulesItem object itself. + */ + public IpPrefixPropertiesIpPrefixRulesItem withSubnetMaskLength(Integer subnetMaskLength) { + this.subnetMaskLength = subnetMaskLength; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model IpPrefixPropertiesIpPrefixRulesItem")); + } + if (networkPrefix() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkPrefix in model IpPrefixPropertiesIpPrefixRulesItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpPrefixPropertiesIpPrefixRulesItem.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixes.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixes.java new file mode 100644 index 0000000000000..c2ffe3ce88be4 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixes.java @@ -0,0 +1,179 @@ +// Copyright (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 IpPrefixes. */ +public interface IpPrefixes { + /** + * Gets an IP Prefix. + * + *

Implements IP Prefix GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IPPrefix resource definition along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String ipPrefixName, Context context); + + /** + * Gets an IP Prefix. + * + *

Implements IP Prefix GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IPPrefix resource definition. + */ + IpPrefix getByResourceGroup(String resourceGroupName, String ipPrefixName); + + /** + * Deletes the IP Prefix. + * + *

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

Implements IP Prefix DELETE method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ipPrefixName Name of the IP Prefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ipPrefixName, Context context); + + /** + * List IpPrefixes by resource group. + * + *

Implements IpPrefixes 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 IpPrefixes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IpPrefixes by resource group. + * + *

Implements IpPrefixes 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 IpPrefixes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List IpPrefixes by subscription. + * + *

Implements IpPrefixes 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 IpPrefixes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IpPrefixes by subscription. + * + *

Implements IpPrefixes 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 IpPrefixes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets an IP Prefix. + * + *

Implements IP Prefix 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 IPPrefix resource definition along with {@link Response}. + */ + IpPrefix getById(String id); + + /** + * Gets an IP Prefix. + * + *

Implements IP Prefix 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 IPPrefix resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the IP Prefix. + * + *

Implements IP Prefix 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 the IP Prefix. + * + *

Implements IP Prefix 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 IpPrefix resource. + * + * @param name resource name. + * @return the first stage of the new IpPrefix definition. + */ + IpPrefix.DefinitionStages.Blank define(String name); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixesListResult.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixesListResult.java new file mode 100644 index 0000000000000..b0ce880b8a338 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/IpPrefixesListResult.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.IpPrefixInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IpPrefixes. */ +@Fluent +public final class IpPrefixesListResult { + /* + * List of IPPrefix 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 IpPrefixesListResult class. */ + public IpPrefixesListResult() { + } + + /** + * Get the value property: List of IPPrefix resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IPPrefix resources. + * + * @param value the value value to set. + * @return the IpPrefixesListResult object itself. + */ + public IpPrefixesListResult 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 IpPrefixesListResult object itself. + */ + public IpPrefixesListResult 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 0000000000000..091b354a5d6c8 --- /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 0000000000000..d6f3b6865f35b --- /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 0000000000000..542cba752b940 --- /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 0000000000000..64bfaa34b064d --- /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 0000000000000..8cfcf9bdab27c --- /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 0000000000000..f866fa62597ac --- /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 0000000000000..7b33fcaec50bc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomain.java @@ -0,0 +1,523 @@ +// Copyright (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. + */ + AggregateRouteConfiguration 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(AggregateRouteConfiguration 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(AggregateRouteConfiguration 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 0000000000000..152a6bb96ff44 --- /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 AggregateRouteConfiguration 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( + AggregateRouteConfiguration 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/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy.java new file mode 100644 index 0000000000000..2e9c3ac7918c3 --- /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 0000000000000..2d215adc72c63 --- /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 0000000000000..652bbc1d6e720 --- /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 0000000000000..158eece66a76b --- /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 final 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 0000000000000..31b3165dd5cf9 --- /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 Layer3IpPrefixProperties { + /* + * 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 0000000000000..ad4eec6ee6cf1 --- /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. Example: 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. Example: 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. Example: 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. Example: 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 Layer3IpPrefixProperties class. */ + public Layer3IpPrefixProperties() { + } + + /** + * Get the primaryIpv4Prefix property: IPv4 Address Prefix of CE-PE interconnect links. Example: 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. Example: 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 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. Example: + * 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. Example: + * 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 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. Example: + * 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. Example: + * 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 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. Example: + * 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. Example: + * 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 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/Layer3OptionAProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3OptionAProperties.java new file mode 100644 index 0000000000000..3bea6efdb90eb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/Layer3OptionAProperties.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 Layer3OptionAProperties 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 Layer3OptionAProperties class. */ + public Layer3OptionAProperties() { + } + + /** + * 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 Layer3OptionAProperties object itself. + */ + public Layer3OptionAProperties 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 Layer3OptionAProperties object itself. + */ + public Layer3OptionAProperties 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 Layer3OptionAProperties object itself. + */ + public Layer3OptionAProperties 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 Layer3OptionAProperties object itself. + */ + public Layer3OptionAProperties withBfdConfiguration(BfdConfiguration bfdConfiguration) { + this.bfdConfiguration = bfdConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3OptionAProperties withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3OptionAProperties withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3OptionAProperties withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public Layer3OptionAProperties 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/ManagedResourceGroupConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagedResourceGroupConfiguration.java new file mode 100644 index 0000000000000..64e3ab03cd324 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagedResourceGroupConfiguration.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 ManagedResourceGroupConfiguration { + /* + * 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 ManagedResourceGroupConfiguration class. */ + public ManagedResourceGroupConfiguration() { + } + + /** + * 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 ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration 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 ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration 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/ManagementNetworkConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagementNetworkConfiguration.java new file mode 100644 index 0000000000000..66ef5efddb09b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ManagementNetworkConfiguration.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; + +/** Configuration to be used to setup the management network. */ +@Fluent +public final class ManagementNetworkConfiguration { + /* + * Configuration for infrastructure vpn. + */ + @JsonProperty(value = "infrastructureVpnConfiguration", required = true) + private VpnConfigurationProperties infrastructureVpnConfiguration; + + /* + * Configuration for workload vpn. + */ + @JsonProperty(value = "workloadVpnConfiguration", required = true) + private VpnConfigurationProperties workloadVpnConfiguration; + + /** Creates an instance of ManagementNetworkConfiguration class. */ + public ManagementNetworkConfiguration() { + } + + /** + * Get the infrastructureVpnConfiguration property: Configuration for infrastructure vpn. + * + * @return the infrastructureVpnConfiguration value. + */ + public VpnConfigurationProperties infrastructureVpnConfiguration() { + return this.infrastructureVpnConfiguration; + } + + /** + * Set the infrastructureVpnConfiguration property: Configuration for infrastructure vpn. + * + * @param infrastructureVpnConfiguration the infrastructureVpnConfiguration value to set. + * @return the ManagementNetworkConfiguration object itself. + */ + public ManagementNetworkConfiguration withInfrastructureVpnConfiguration( + VpnConfigurationProperties infrastructureVpnConfiguration) { + this.infrastructureVpnConfiguration = infrastructureVpnConfiguration; + return this; + } + + /** + * Get the workloadVpnConfiguration property: Configuration for workload vpn. + * + * @return the workloadVpnConfiguration value. + */ + public VpnConfigurationProperties workloadVpnConfiguration() { + return this.workloadVpnConfiguration; + } + + /** + * Set the workloadVpnConfiguration property: Configuration for workload vpn. + * + * @param workloadVpnConfiguration the workloadVpnConfiguration value to set. + * @return the ManagementNetworkConfiguration object itself. + */ + public ManagementNetworkConfiguration withWorkloadVpnConfiguration( + VpnConfigurationProperties 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" + + " ManagementNetworkConfiguration")); + } else { + infrastructureVpnConfiguration().validate(); + } + if (workloadVpnConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property workloadVpnConfiguration in model ManagementNetworkConfiguration")); + } else { + workloadVpnConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementNetworkConfiguration.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NeighborAddress.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NeighborAddress.java new file mode 100644 index 0000000000000..25ec50bab3ea5 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NeighborAddress.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; + +/** Neighbor Address properties. */ +@Fluent +public final class NeighborAddress { + /* + * IP Address. + */ + @JsonProperty(value = "address") + private String address; + + /* + * OperationalState of the NeighborAddress. + */ + @JsonProperty(value = "operationalState", access = JsonProperty.Access.WRITE_ONLY) + private String operationalState; + + /** Creates an instance of NeighborAddress class. */ + public NeighborAddress() { + } + + /** + * Get the address property: IP Address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: IP Address. + * + * @param address the address value to set. + * @return the NeighborAddress object itself. + */ + public NeighborAddress withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the operationalState property: OperationalState of the NeighborAddress. + * + * @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/NetworkDevice.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDevice.java new file mode 100644 index 0000000000000..797c8dd38f0b1 --- /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 0000000000000..e9f5256b0478f --- /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 0000000000000..74ad53686dfc3 --- /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 0000000000000..6190a24f10556 --- /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 0000000000000..205a33c4ffc50 --- /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/NetworkDeviceRoleProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleProperties.java new file mode 100644 index 0000000000000..1aeea9beed5bc --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleProperties.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 NetworkDeviceRoleProperties { + /* + * 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 NetworkDeviceRoleProperties class. */ + public NetworkDeviceRoleProperties() { + } + + /** + * 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 NetworkDeviceRoleProperties object itself. + */ + public NetworkDeviceRoleProperties 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 NetworkDeviceRoleProperties object itself. + */ + public NetworkDeviceRoleProperties 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 NetworkDeviceRoleProperties object itself. + */ + public NetworkDeviceRoleProperties 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/NetworkDeviceRoleTypes.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceRoleTypes.java new file mode 100644 index 0000000000000..91e736618b217 --- /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 0000000000000..236bccad4bc5f --- /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. + */ + DeviceLimits 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/NetworkDeviceSkus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkDeviceSkus.java new file mode 100644 index 0000000000000..b30b9889bd00d --- /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 0000000000000..31628d598c7c2 --- /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 0000000000000..7084859ef89b0 --- /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 0000000000000..95bd2092dcc7d --- /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 0000000000000..1ff93812a9b7e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabric.java @@ -0,0 +1,514 @@ +// Copyright (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. Example: 10.1.0.0/19. + * + * @return the ipv4Prefix value. + */ + String ipv4Prefix(); + + /** + * Gets the ipv6Prefix property: IPv6Prefix for Management Network. Example: 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. + */ + TerminalServerConfiguration terminalServerConfiguration(); + + /** + * Gets the managementNetworkConfiguration property: Configuration to be used to setup the management network. + * + * @return the managementNetworkConfiguration value. + */ + ManagementNetworkConfiguration 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. Example: 10.1.0.0/19.. + * + * @param ipv4Prefix IPv4Prefix for Management Network. Example: 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. Example: 3FFE:FFFF:0:CD40::/59.. + * + * @param ipv6Prefix IPv6Prefix for Management Network. Example: 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(TerminalServerConfiguration 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( + ManagementNetworkConfiguration 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(TerminalServerPatchableProperties 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 0000000000000..777afafdd7ab9 --- /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. + */ + InfrastructureServices infrastructureServices(); + + /** + * Gets the workloadServices property: WorkloadServices IP ranges. + * + * @return the workloadServices value. + */ + WorkloadServices workloadServices(); + + /** + * Gets the managedResourceGroupConfiguration property: Managed Resource Group configuration properties. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedResourceGroupConfiguration 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( + ManagedResourceGroupConfiguration 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 0000000000000..5ab5b8ab0e32a --- /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 0000000000000..6b5518a2ee262 --- /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/NetworkFabricControllers.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricControllers.java new file mode 100644 index 0000000000000..5d02f8c419150 --- /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 0000000000000..e698c1329a399 --- /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 0000000000000..d57ac95df8923 --- /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 0000000000000..ae97e097b49da --- /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 TerminalServerPatchableProperties 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( + TerminalServerPatchableProperties 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 0000000000000..4637e94b702e4 --- /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/NetworkFabricSku.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkFabricSku.java new file mode 100644 index 0000000000000..26de99f6b502d --- /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 0000000000000..f52084c806fd9 --- /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 0000000000000..2f4f9377ec390 --- /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 0000000000000..26bf2593d45f3 --- /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 0000000000000..1de1ed338c9d3 --- /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 0000000000000..fc0ed21624b8f --- /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 0000000000000..f12eac310c88f --- /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 0000000000000..2bad8572ac7cc --- /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 0000000000000..f5a453341167d --- /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 0000000000000..a519bf2c76fcc --- /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 0000000000000..7f166e28ea550 --- /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 0000000000000..f4ab9a7f82d9e --- /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 0000000000000..6c659d76e2482 --- /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/NetworkRackSkus.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkRackSkus.java new file mode 100644 index 0000000000000..c7aa583234201 --- /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 0000000000000..ed6c22d164649 --- /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 0000000000000..17384714b5033 --- /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 0000000000000..1a717927634a1 --- /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 0000000000000..f1bf22662b50e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnect.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.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 nniType property: Type of NNI used. Example: CE | NPB. + * + * @return the nniType value. + */ + NniType nniType(); + + /** + * 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. + */ + Layer2Configuration 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.WithNniType, + 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 nniType. */ + interface WithNniType { + /** + * Specifies the nniType property: Type of NNI used. Example: CE | NPB. + * + * @param nniType Type of NNI used. Example: CE | NPB. + * @return the next definition stage. + */ + WithCreate withNniType(NniType nniType); + } + /** 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(Layer2Configuration 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/NetworkToNetworkInterconnects.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NetworkToNetworkInterconnects.java new file mode 100644 index 0000000000000..be9ba54483277 --- /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 0000000000000..6a3476529d813 --- /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/NniType.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NniType.java new file mode 100644 index 0000000000000..8eb52627092e1 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/NniType.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; + +/** Type of NNI used. Example: CE | NPB. */ +public final class NniType extends ExpandableStringEnum { + /** Static value CE for NniType. */ + public static final NniType CE = fromString("CE"); + + /** Static value NPB for NniType. */ + public static final NniType NPB = fromString("NPB"); + + /** + * Creates a new instance of NniType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NniType() { + } + + /** + * Creates or finds a NniType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NniType. + */ + @JsonCreator + public static NniType fromString(String name) { + return fromString(name, NniType.class); + } + + /** + * Gets known NniType values. + * + * @return known NniType values. + */ + public static Collection values() { + return values(NniType.class); + } +} 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 0000000000000..a6a86e4e84d14 --- /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 0000000000000..3c0d1bc7f44cf --- /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 0000000000000..b2db21c5ef1c9 --- /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 0000000000000..b8765466429af --- /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 0000000000000..97161d5b573e2 --- /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 0000000000000..08c4c07efe43e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionAProperties.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 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; + + /* + * Peer ASN number.Example : 28 + */ + @JsonProperty(value = "peerASN") + private Integer peerAsn; + + /* + * BFD Configuration properties. + */ + @JsonProperty(value = "bfdConfiguration") + private FabricBfdConfiguration 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 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 FabricBfdConfiguration 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(FabricBfdConfiguration 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/OptionBProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/OptionBProperties.java new file mode 100644 index 0000000000000..a4c555d46ac63 --- /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 0000000000000..838eb7a624814 --- /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. */ +@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 0000000000000..bbda7feb92af1 --- /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 0000000000000..e2933437a097d --- /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 0000000000000..a81ea89e2b8c3 --- /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 0000000000000..7f7a77922cba1 --- /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/ProvisioningState.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/ProvisioningState.java new file mode 100644 index 0000000000000..1ba4b109fdc34 --- /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 0000000000000..e963b12548d34 --- /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 0000000000000..5b7847bbb185e --- /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 0000000000000..06c5a0737a4a8 --- /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 0000000000000..4d1e4e8e3be67 --- /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 0000000000000..aeeca398fecf2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicy.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.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 statements property: Route Policy statements. + * + * @return the statements value. + */ + List statements(); + + /** + * 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.WithStatements, + 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. + */ + WithStatements withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the RoutePolicy definition allowing to specify statements. */ + interface WithStatements { + /** + * Specifies the statements property: Route Policy statements.. + * + * @param statements Route Policy statements. + * @return the next definition stage. + */ + WithCreate withStatements(List statements); + } + /** + * 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.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 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 { + /** + * 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); + } + } + /** + * 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 0000000000000..08f853add4f63 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyPatch.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.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 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 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/RoutePolicyStatementProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyStatementProperties.java new file mode 100644 index 0000000000000..8aaabf0951d9d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/RoutePolicyStatementProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route Policy Statement properties.. */ +@Fluent +public final class RoutePolicyStatementProperties extends AnnotationResource { + /* + * Sequence to insert to/delete from existing route. + */ + @JsonProperty(value = "sequenceNumber", required = true) + private long sequenceNumber; + + /* + * Route policy condition properties. + */ + @JsonProperty(value = "condition", required = true) + private StatementConditionProperties condition; + + /* + * Route policy action properties. + */ + @JsonProperty(value = "action", required = true) + private StatementActionProperties action; + + /** Creates an instance of RoutePolicyStatementProperties class. */ + public RoutePolicyStatementProperties() { + } + + /** + * Get the sequenceNumber property: Sequence to insert to/delete from existing route. + * + * @return the sequenceNumber value. + */ + public long sequenceNumber() { + return this.sequenceNumber; + } + + /** + * Set the sequenceNumber property: Sequence to insert to/delete from existing route. + * + * @param sequenceNumber the sequenceNumber value to set. + * @return the RoutePolicyStatementProperties object itself. + */ + public RoutePolicyStatementProperties withSequenceNumber(long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get the condition property: Route policy condition properties. + * + * @return the condition value. + */ + public StatementConditionProperties condition() { + return this.condition; + } + + /** + * Set the condition property: Route policy condition properties. + * + * @param condition the condition value to set. + * @return the RoutePolicyStatementProperties object itself. + */ + public RoutePolicyStatementProperties withCondition(StatementConditionProperties condition) { + this.condition = condition; + return this; + } + + /** + * Get the action property: Route policy action properties. + * + * @return the action value. + */ + public StatementActionProperties action() { + return this.action; + } + + /** + * Set the action property: Route policy action properties. + * + * @param action the action value to set. + * @return the RoutePolicyStatementProperties object itself. + */ + public RoutePolicyStatementProperties withAction(StatementActionProperties action) { + this.action = action; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoutePolicyStatementProperties 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 (condition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property condition in model RoutePolicyStatementProperties")); + } else { + condition().validate(); + } + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model RoutePolicyStatementProperties")); + } else { + action().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutePolicyStatementProperties.class); +} 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 0000000000000..a4edae2e86819 --- /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/StatementActionProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementActionProperties.java new file mode 100644 index 0000000000000..48b3c3ce6b76e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementActionProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route policy action properties. */ +@Fluent +public final class StatementActionProperties { + /* + * localPreference of the route policy. + */ + @JsonProperty(value = "localPreference") + private Long localPreference; + + /* + * action. Example: Permit | Deny. + */ + @JsonProperty(value = "actionType", required = true) + private CommunityActionTypes actionType; + + /* + * IP Community Properties. + */ + @JsonProperty(value = "ipCommunityProperties") + private ActionIpCommunityProperties ipCommunityProperties; + + /* + * IP Extended Community Properties. + */ + @JsonProperty(value = "ipExtendedCommunityProperties") + private ActionIpExtendedCommunityProperties ipExtendedCommunityProperties; + + /** Creates an instance of StatementActionProperties class. */ + public StatementActionProperties() { + } + + /** + * Get the localPreference property: localPreference of the route policy. + * + * @return the localPreference value. + */ + public Long localPreference() { + return this.localPreference; + } + + /** + * Set the localPreference property: localPreference of the route policy. + * + * @param localPreference the localPreference value to set. + * @return the StatementActionProperties object itself. + */ + public StatementActionProperties withLocalPreference(Long localPreference) { + this.localPreference = localPreference; + return this; + } + + /** + * Get the actionType property: action. Example: Permit | Deny. + * + * @return the actionType value. + */ + public CommunityActionTypes actionType() { + return this.actionType; + } + + /** + * Set the actionType property: action. Example: Permit | Deny. + * + * @param actionType the actionType value to set. + * @return the StatementActionProperties object itself. + */ + public StatementActionProperties withActionType(CommunityActionTypes actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the ipCommunityProperties property: IP Community Properties. + * + * @return the ipCommunityProperties value. + */ + public ActionIpCommunityProperties ipCommunityProperties() { + return this.ipCommunityProperties; + } + + /** + * Set the ipCommunityProperties property: IP Community Properties. + * + * @param ipCommunityProperties the ipCommunityProperties value to set. + * @return the StatementActionProperties object itself. + */ + public StatementActionProperties withIpCommunityProperties(ActionIpCommunityProperties ipCommunityProperties) { + this.ipCommunityProperties = ipCommunityProperties; + return this; + } + + /** + * Get the ipExtendedCommunityProperties property: IP Extended Community Properties. + * + * @return the ipExtendedCommunityProperties value. + */ + public ActionIpExtendedCommunityProperties ipExtendedCommunityProperties() { + return this.ipExtendedCommunityProperties; + } + + /** + * Set the ipExtendedCommunityProperties property: IP Extended Community Properties. + * + * @param ipExtendedCommunityProperties the ipExtendedCommunityProperties value to set. + * @return the StatementActionProperties object itself. + */ + public StatementActionProperties withIpExtendedCommunityProperties( + ActionIpExtendedCommunityProperties ipExtendedCommunityProperties) { + this.ipExtendedCommunityProperties = ipExtendedCommunityProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actionType in model StatementActionProperties")); + } + if (ipCommunityProperties() != null) { + ipCommunityProperties().validate(); + } + if (ipExtendedCommunityProperties() != null) { + ipExtendedCommunityProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StatementActionProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementConditionProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementConditionProperties.java new file mode 100644 index 0000000000000..4daad791b46ac --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StatementConditionProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route policy statement condition properties. */ +@Fluent +public final class StatementConditionProperties extends IpCommunityIdList { + /* + * Arm Resource Id of IpPrefix. + */ + @JsonProperty(value = "ipPrefixId") + private String ipPrefixId; + + /* + * List of IP Extended Community resource IDs. + */ + @JsonProperty(value = "ipExtendedCommunityIds") + private List ipExtendedCommunityIds; + + /** Creates an instance of StatementConditionProperties class. */ + public StatementConditionProperties() { + } + + /** + * Get the ipPrefixId property: Arm Resource Id of IpPrefix. + * + * @return the ipPrefixId value. + */ + public String ipPrefixId() { + return this.ipPrefixId; + } + + /** + * Set the ipPrefixId property: Arm Resource Id of IpPrefix. + * + * @param ipPrefixId the ipPrefixId value to set. + * @return the StatementConditionProperties object itself. + */ + public StatementConditionProperties withIpPrefixId(String ipPrefixId) { + this.ipPrefixId = ipPrefixId; + return this; + } + + /** + * Get the ipExtendedCommunityIds property: List of IP Extended Community resource IDs. + * + * @return the ipExtendedCommunityIds value. + */ + public List ipExtendedCommunityIds() { + return this.ipExtendedCommunityIds; + } + + /** + * Set the ipExtendedCommunityIds property: List of IP Extended Community resource IDs. + * + * @param ipExtendedCommunityIds the ipExtendedCommunityIds value to set. + * @return the StatementConditionProperties object itself. + */ + public StatementConditionProperties withIpExtendedCommunityIds(List ipExtendedCommunityIds) { + this.ipExtendedCommunityIds = ipExtendedCommunityIds; + return this; + } + + /** {@inheritDoc} */ + @Override + public StatementConditionProperties withIpCommunityIds(List ipCommunityIds) { + super.withIpCommunityIds(ipCommunityIds); + 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/StaticRouteConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteConfiguration.java new file mode 100644 index 0000000000000..68abc94699b88 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteConfiguration.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** staticRouteConfiguration model. */ +@Fluent +public final class StaticRouteConfiguration { + /* + * 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 StaticRouteConfiguration class. */ + public StaticRouteConfiguration() { + } + + /** + * 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 StaticRouteConfiguration object itself. + */ + public StaticRouteConfiguration 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 StaticRouteConfiguration object itself. + */ + public StaticRouteConfiguration 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 StaticRouteConfiguration object itself. + */ + public StaticRouteConfiguration 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/StaticRouteProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteProperties.java new file mode 100644 index 0000000000000..ed95378579e38 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/StaticRouteProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** Static Route properties. */ +@Fluent +public final class StaticRouteProperties { + /* + * IPv4 | IPv6 Prefix. + */ + @JsonProperty(value = "prefix", required = true) + private String prefix; + + /* + * List of next hop IPv4 | IPv6 addresses. + */ + @JsonProperty(value = "nextHop", required = true) + private List nextHop; + + /** Creates an instance of StaticRouteProperties class. */ + public StaticRouteProperties() { + } + + /** + * Get the prefix property: IPv4 | IPv6 Prefix. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: IPv4 | IPv6 Prefix. + * + * @param prefix the prefix value to set. + * @return the StaticRouteProperties object itself. + */ + public StaticRouteProperties withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the nextHop property: List of next hop IPv4 | IPv6 addresses. + * + * @return the nextHop value. + */ + public List nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: List of next hop IPv4 | IPv6 addresses. + * + * @param nextHop the nextHop value to set. + * @return the StaticRouteProperties object itself. + */ + public StaticRouteProperties 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 StaticRouteProperties")); + } + if (nextHop() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHop in model StaticRouteProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StaticRouteProperties.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 0000000000000..0ed2f753460a0 --- /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/SupportedConnectorProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedConnectorProperties.java new file mode 100644 index 0000000000000..a76b37e1a306b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedConnectorProperties.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 SupportedConnectorProperties { + /* + * 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 SupportedConnectorProperties class. */ + public SupportedConnectorProperties() { + } + + /** + * 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 SupportedConnectorProperties object itself. + */ + public SupportedConnectorProperties 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 SupportedConnectorProperties object itself. + */ + public SupportedConnectorProperties 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/SupportedVersionProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedVersionProperties.java new file mode 100644 index 0000000000000..ea3066c13cb96 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/SupportedVersionProperties.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 supported version properties. */ +@Fluent +public final class SupportedVersionProperties { + /* + * 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 SupportedVersionProperties class. */ + public SupportedVersionProperties() { + } + + /** + * 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 SupportedVersionProperties object itself. + */ + public SupportedVersionProperties 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 SupportedVersionProperties object itself. + */ + public SupportedVersionProperties 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 SupportedVersionProperties object itself. + */ + public SupportedVersionProperties 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 SupportedVersionProperties object itself. + */ + public SupportedVersionProperties 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 SupportedVersionProperties object itself. + */ + public SupportedVersionProperties 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/TerminalServerConfiguration.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerConfiguration.java new file mode 100644 index 0000000000000..0289a0bda8b27 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerConfiguration.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 TerminalServerConfiguration extends Layer3IpPrefixProperties { + /* + * 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 TerminalServerConfiguration class. */ + public TerminalServerConfiguration() { + } + + /** + * 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 TerminalServerConfiguration object itself. + */ + public TerminalServerConfiguration 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 TerminalServerConfiguration object itself. + */ + public TerminalServerConfiguration 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 TerminalServerConfiguration object itself. + */ + public TerminalServerConfiguration withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerConfiguration withPrimaryIpv4Prefix(String primaryIpv4Prefix) { + super.withPrimaryIpv4Prefix(primaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerConfiguration withPrimaryIpv6Prefix(String primaryIpv6Prefix) { + super.withPrimaryIpv6Prefix(primaryIpv6Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerConfiguration withSecondaryIpv4Prefix(String secondaryIpv4Prefix) { + super.withSecondaryIpv4Prefix(secondaryIpv4Prefix); + return this; + } + + /** {@inheritDoc} */ + @Override + public TerminalServerConfiguration 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/TerminalServerPatchParameters.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchParameters.java new file mode 100644 index 0000000000000..cf1660d35fa3d --- /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 TerminalServerPatchableProperties 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 TerminalServerPatchableProperties 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( + TerminalServerPatchableProperties 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/TerminalServerPatchableProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/TerminalServerPatchableProperties.java new file mode 100644 index 0000000000000..7d63156dff4ba --- /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 0000000000000..fbfd2e237166a --- /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 0000000000000..e5e2dd2741998 --- /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 0000000000000..ed9fed8814a47 --- /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/VpnConfigurationProperties.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VpnConfigurationProperties.java new file mode 100644 index 0000000000000..66b531bf6df50 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/VpnConfigurationProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for infrastructure vpn. */ +@Fluent +public final class VpnConfigurationProperties { + /* + * 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", required = true) + private PeeringOption peeringOption; + + /* + * option B properties + */ + @JsonProperty(value = "optionBProperties") + private OptionBPropertiesAutoGenerated optionBProperties; + + /* + * option A properties + */ + @JsonProperty(value = "optionAProperties") + private OptionAProperties optionAProperties; + + /** Creates an instance of VpnConfigurationProperties class. */ + public VpnConfigurationProperties() { + } + + /** + * 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 VpnConfigurationProperties object itself. + */ + public VpnConfigurationProperties 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 VpnConfigurationProperties object itself. + */ + public VpnConfigurationProperties withOptionBProperties(OptionBPropertiesAutoGenerated optionBProperties) { + this.optionBProperties = optionBProperties; + return this; + } + + /** + * Get the optionAProperties property: option A properties. + * + * @return the optionAProperties value. + */ + public OptionAProperties optionAProperties() { + return this.optionAProperties; + } + + /** + * Set the optionAProperties property: option A properties. + * + * @param optionAProperties the optionAProperties value to set. + * @return the VpnConfigurationProperties object itself. + */ + public VpnConfigurationProperties withOptionAProperties(OptionAProperties optionAProperties) { + this.optionAProperties = optionAProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (peeringOption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property peeringOption in model VpnConfigurationProperties")); + } + if (optionBProperties() != null) { + optionBProperties().validate(); + } + if (optionAProperties() != null) { + optionAProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnConfigurationProperties.class); +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WellKnownCommunities.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WellKnownCommunities.java new file mode 100644 index 0000000000000..9efb9bcd55cca --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WellKnownCommunities.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * `Internet` - Advertise routes to internet community. `LocalAS` - Advertise routes to only localAS peers. + * `NoAdvertise` - Don't advertise routes to any peer. `NoExport` - Don't export to next AS. `GShut` - Graceful Shutdown + * (GSHUT) withdraw routes before terminating BGP connection. + */ +public final class WellKnownCommunities extends ExpandableStringEnum { + /** Static value Internet for WellKnownCommunities. */ + public static final WellKnownCommunities INTERNET = fromString("Internet"); + + /** Static value LocalAS for WellKnownCommunities. */ + public static final WellKnownCommunities LOCAL_AS = fromString("LocalAS"); + + /** Static value NoAdvertise for WellKnownCommunities. */ + public static final WellKnownCommunities NO_ADVERTISE = fromString("NoAdvertise"); + + /** Static value NoExport for WellKnownCommunities. */ + public static final WellKnownCommunities NO_EXPORT = fromString("NoExport"); + + /** Static value GShut for WellKnownCommunities. */ + public static final WellKnownCommunities GSHUT = fromString("GShut"); + + /** + * Creates a new instance of WellKnownCommunities value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WellKnownCommunities() { + } + + /** + * Creates or finds a WellKnownCommunities from its string representation. + * + * @param name a name to look for. + * @return the corresponding WellKnownCommunities. + */ + @JsonCreator + public static WellKnownCommunities fromString(String name) { + return fromString(name, WellKnownCommunities.class); + } + + /** + * Gets known WellKnownCommunities values. + * + * @return known WellKnownCommunities values. + */ + public static Collection values() { + return values(WellKnownCommunities.class); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WorkloadServices.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WorkloadServices.java new file mode 100644 index 0000000000000..cd94cd944e52f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/main/java/com/azure/resourcemanager/managednetworkfabric/models/WorkloadServices.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 WorkloadServices { + /* + * 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 WorkloadServices class. */ + public WorkloadServices() { + } + + /** + * 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 WorkloadServices object itself. + */ + public WorkloadServices 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 WorkloadServices object itself. + */ + public WorkloadServices 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/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 0000000000000..cfc08e08f27ed --- /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 0000000000000..9574c0622727a --- /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 0000000000000..0d7f66437b384 --- /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 0000000000000..494461342bc84 --- /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.AccessControlListConditionProperties; +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 AccessControlListConditionProperties() + .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 0000000000000..f0817efe33265 --- /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 0000000000000..9472d4f3c2a7b --- /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 0000000000000..983bbccfb7435 --- /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 0000000000000..1ac827a61f3ae --- /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 0000000000000..5307c596122e1 --- /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.AccessControlListConditionProperties; +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) + .withConditions( + Arrays + .asList( + new AccessControlListConditionProperties() + .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 0000000000000..eb2ed0af2b5b3 --- /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 0000000000000..aae8bb0e5f76c --- /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 0000000000000..3ef1c0ea5d4b5 --- /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 0000000000000..c536ffb937000 --- /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 0000000000000..d687f99260fc5 --- /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 0000000000000..ebe28f329a52a --- /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 0000000000000..10739a10e66f9 --- /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 0000000000000..9414d80bc538a --- /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 0000000000000..2d0f11c1082be --- /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 0000000000000..b7aa445b20300 --- /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.Layer3OptionAProperties; +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 Layer3OptionAProperties() + .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 0000000000000..d100d00c57afb --- /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 0000000000000..e60dc997c87b8 --- /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 0000000000000..544a33f74c323 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksCreateSamples.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.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; +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 ConnectedSubnet().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets(Arrays.asList(new ConnectedSubnet().withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new StaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new BgpConfiguration() + .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 NeighborAddress().withAddress("10.1.0.0"))) + .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress().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 0000000000000..7108d180dab7c --- /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 0000000000000..2ead7b2711a25 --- /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 0000000000000..5b6e7b40ca473 --- /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 0000000000000..fa9863c9c53e5 --- /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 0000000000000..99845fbf504f7 --- /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 0000000000000..b3bd226ef98cb --- /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 0000000000000..cc0c71bdbe7ff --- /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 0000000000000..6058664f1bdb0 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/InternalNetworksUpdateSamples.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.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.AllowASOverride; +import com.azure.resourcemanager.managednetworkfabric.models.BfdConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BgpConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.ConnectedSubnet; +import com.azure.resourcemanager.managednetworkfabric.models.InternalNetwork; +import com.azure.resourcemanager.managednetworkfabric.models.NeighborAddress; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.StaticRouteProperties; +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 ConnectedSubnet().withPrefix("10.0.0.0/24"))) + .withConnectedIPv6Subnets(Arrays.asList(new ConnectedSubnet().withPrefix("3FFE:FFFF:0:CD30::a0/29"))) + .withStaticRouteConfiguration( + new StaticRouteConfiguration() + .withBfdConfiguration(new BfdConfiguration()) + .withIpv4Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("10.1.0.0/24") + .withNextHop(Arrays.asList("10.0.0.1")))) + .withIpv6Routes( + Arrays + .asList( + new StaticRouteProperties() + .withPrefix("2fff::/64") + .withNextHop(Arrays.asList("2ffe::1"))))) + .withBgpConfiguration( + new BgpConfiguration() + .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 NeighborAddress().withAddress("10.1.0.0"))) + .withIpv6NeighborAddress(Arrays.asList(new NeighborAddress().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/IpCommunitiesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.java new file mode 100644 index 0000000000000..346a85bf369fb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesCreateSamples.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.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.WellKnownCommunities; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunities Create. */ +public final class IpCommunitiesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunities() + .define("example-ipCommunity") + .withRegion("EastUS") + .withExistingResourceGroup("rgIpCommunityLists") + .withTags(mapOf("key2814", "")) + .withAction(CommunityActionTypes.PERMIT) + .withWellKnownCommunities( + Arrays + .asList( + WellKnownCommunities.INTERNET, + WellKnownCommunities.LOCAL_AS, + WellKnownCommunities.NO_EXPORT, + WellKnownCommunities.GSHUT)) + .withCommunityMembers(Arrays.asList("1234:5678")) + .withAnnotation("annotationValue") + .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/IpCommunitiesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesDeleteSamples.java new file mode 100644 index 0000000000000..40f81e252088a --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesDeleteSamples.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 IpCommunities Delete. */ +public final class IpCommunitiesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().delete("resourceGroupName", "IpCommunityList1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..bc0d641a81564 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesGetByResourceGroupSamples.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 IpCommunities GetByResourceGroup. */ +public final class IpCommunitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipCommunities() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-ipCommunity", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..beee9932d2bc7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListByResourceGroupSamples.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 IpCommunities ListByResourceGroup. */ +public final class IpCommunitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListSamples.java new file mode 100644 index 0000000000000..491fde7c25e92 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesListSamples.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 IpCommunities List. */ +public final class IpCommunitiesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipCommunities().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesUpdateSamples.java new file mode 100644 index 0000000000000..2caba65e36761 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpCommunitiesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpCommunities Update. */ +public final class IpCommunitiesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpCommunities_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpCommunities_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipCommunitiesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpCommunity resource = + manager + .ipCommunities() + .getByResourceGroupWithResponse( + "resourceGroupName", "example-ipCommunity", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2814", "")).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/IpExtendedCommunitiesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.java new file mode 100644 index 0000000000000..a245610321ca2 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesCreateSamples.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.CommunityActionTypes; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpExtendedCommunities Create. */ +public final class IpExtendedCommunitiesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .define("example_ipExtendedCommunity") + .withRegion("EastUs") + .withExistingResourceGroup("rgIpExtendedCommunityLists") + .withTags(mapOf("key5054", "key")) + .withAction(CommunityActionTypes.PERMIT) + .withRouteTargets(Arrays.asList("1234:5678")) + .withAnnotation("annotationValue") + .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/IpExtendedCommunitiesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesDeleteSamples.java new file mode 100644 index 0000000000000..2ddfc0e157f08 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesDeleteSamples.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 IpExtendedCommunities Delete. */ +public final class IpExtendedCommunitiesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .delete("rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..65f926b2deb51 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesGetByResourceGroupSamples.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 IpExtendedCommunities GetByResourceGroup. */ +public final class IpExtendedCommunitiesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .getByResourceGroupWithResponse( + "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ebabc448b4d60 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListByResourceGroupSamples.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 IpExtendedCommunities ListByResourceGroup. */ +public final class IpExtendedCommunitiesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipExtendedCommunities() + .listByResourceGroup("rgIpExtendedCommunityLists", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListSamples.java new file mode 100644 index 0000000000000..276eacf825688 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesListSamples.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 IpExtendedCommunities List. */ +public final class IpExtendedCommunitiesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipExtendedCommunities().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java new file mode 100644 index 0000000000000..7629ad16e8a9b --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpExtendedCommunitiesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpExtendedCommunities Update. */ +public final class IpExtendedCommunitiesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpExtendedCommunities_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipExtendedCommunitiesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpExtendedCommunity resource = + manager + .ipExtendedCommunities() + .getByResourceGroupWithResponse( + "rgIpExtendedCommunityLists", "example_ipExtendedCommunity", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5054", "key1")).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/IpPrefixesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.java new file mode 100644 index 0000000000000..248ca3270b0d7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesCreateSamples.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.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.Condition; +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPropertiesIpPrefixRulesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpPrefixes Create. */ +public final class IpPrefixesCreateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Create_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesCreateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixes() + .define("example-ipPrefix") + .withRegion("EastUS") + .withExistingResourceGroup("resourcegroupname") + .withIpPrefixRules( + Arrays + .asList( + new IpPrefixPropertiesIpPrefixRulesItem() + .withAction(CommunityActionTypes.PERMIT) + .withSequenceNumber(12L) + .withNetworkPrefix("1.1.1.0/24") + .withCondition(Condition.EQUAL_TO) + .withSubnetMaskLength(28))) + .withTags(mapOf("key6404", "")) + .withAnnotation("annotationValue") + .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/IpPrefixesDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesDeleteSamples.java new file mode 100644 index 0000000000000..48e8d63ee46e7 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesDeleteSamples.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 IpPrefixes Delete. */ +public final class IpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesDeleteMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().delete("rgIpPrefixLists", "example-ipPrefix", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a10c11164e515 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesGetByResourceGroupSamples.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 IpPrefixes GetByResourceGroup. */ +public final class IpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Get_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesGetMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager + .ipPrefixes() + .getByResourceGroupWithResponse("resourcegroupname", "example-ipPrefix", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..694eabcebdd60 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListByResourceGroupSamples.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 IpPrefixes ListByResourceGroup. */ +public final class IpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListSamples.java new file mode 100644 index 0000000000000..814d529e24e26 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesListSamples.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 IpPrefixes List. */ +public final class IpPrefixesListSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + manager.ipPrefixes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java new file mode 100644 index 0000000000000..cbc7f2cb2970e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/IpPrefixesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.IpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IpPrefixes Update. */ +public final class IpPrefixesUpdateSamples { + /* + * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/IpPrefixes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: IpPrefixes_Update_MaximumSet_Gen. + * + * @param manager Entry point to ManagednetworkfabricManager. + */ + public static void ipPrefixesUpdateMaximumSetGen( + com.azure.resourcemanager.managednetworkfabric.ManagednetworkfabricManager manager) { + IpPrefix resource = + manager + .ipPrefixes() + .getByResourceGroupWithResponse( + "resourcegroupname", "example-ipPrefix", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3127", "key")).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/L2IsolationDomainsClearArpTableSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L2IsolationDomainsClearArpTableSamples.java new file mode 100644 index 0000000000000..5343817dff8e4 --- /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 0000000000000..4ed8a7b28baaf --- /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 0000000000000..237dc98d5e321 --- /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 0000000000000..9c7952eb4d659 --- /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 0000000000000..842389c80c8e6 --- /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 0000000000000..3fe209c1c2f14 --- /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 0000000000000..f6c0667855566 --- /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 0000000000000..c8d8169378006 --- /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 0000000000000..8c98993af21df --- /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 0000000000000..cd7fc4fb0b3be --- /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 0000000000000..2dc4e38b3d413 --- /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 0000000000000..8a2cde8bf5ebd --- /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 0000000000000..6051b75548f21 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsCreateSamples.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.AggregateRoute; +import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; +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 AggregateRouteConfiguration() + .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.0/24"))) + .withIpv6Routes(Arrays.asList(new AggregateRoute().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 0000000000000..f325b0ff05312 --- /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 0000000000000..e8652fd580c17 --- /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 0000000000000..8d2e00411a3af --- /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 0000000000000..9f431127ad2cc --- /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 0000000000000..ba97732901ee8 --- /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 0000000000000..5e0ec0118114e --- /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 0000000000000..8c3b3e6cf3b99 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/L3IsolationDomainsUpdateSamples.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.AggregateRoute; +import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomain; +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 AggregateRouteConfiguration() + .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.0/24"))) + .withIpv6Routes(Arrays.asList(new AggregateRoute().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 0000000000000..af8ae5c758390 --- /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 0000000000000..ce32c99741a75 --- /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 0000000000000..d726830f70f8b --- /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 0000000000000..725fe6b50bca7 --- /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 0000000000000..4a4b2c45bdb62 --- /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 0000000000000..6b4223cecc59d --- /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 0000000000000..fb47e74830fb7 --- /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 0000000000000..6f60e11b2552e --- /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 0000000000000..61a79b5b6a929 --- /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 0000000000000..2d62dfcf9eed6 --- /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 0000000000000..e7ec69777b42a --- /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 0000000000000..61c86d7576d84 --- /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 0000000000000..9883f81429d05 --- /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 0000000000000..e2382cdf1f82f --- /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 0000000000000..16d5704f26902 --- /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 0000000000000..5cd1f354126b7 --- /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 0000000000000..289a04a5f9965 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricControllersCreateSamples.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.ExpressRouteConnectionInformation; +import com.azure.resourcemanager.managednetworkfabric.models.ManagedResourceGroupConfiguration; +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 ManagedResourceGroupConfiguration().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 0000000000000..898b20febd673 --- /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 0000000000000..b2e12fa7bb3c5 --- /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 0000000000000..d67dc35476d2d --- /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 0000000000000..87e7a9067d7b9 --- /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 0000000000000..95c111c8eda16 --- /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 0000000000000..f8182a998800c --- /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 0000000000000..5c596c28b2374 --- /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 0000000000000..b33d9f3081288 --- /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 0000000000000..4ba036169eca9 --- /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 0000000000000..e96f9668d6c3e --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsCreateSamples.java @@ -0,0 +1,100 @@ +// Copyright (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.ManagementNetworkConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.OptionAProperties; +import com.azure.resourcemanager.managednetworkfabric.models.OptionBPropertiesAutoGenerated; +import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration; +import com.azure.resourcemanager.managednetworkfabric.models.VpnConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** 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("eastuseuap") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("key6468", "")) + .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 TerminalServerConfiguration() + .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 ManagementNetworkConfiguration() + .withInfrastructureVpnConfiguration( + new VpnConfigurationProperties() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10039")) + .withExportRouteTargets(Arrays.asList("65046:10039"))) + .withOptionAProperties( + new OptionAProperties() + .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") + .withMtu(5892) + .withVlanId(2724) + .withPeerAsn(42666))) + .withWorkloadVpnConfiguration( + new VpnConfigurationProperties() + .withPeeringOption(PeeringOption.OPTIONA) + .withOptionBProperties( + new OptionBPropertiesAutoGenerated() + .withImportRouteTargets(Arrays.asList("65046:10050")) + .withExportRouteTargets(Arrays.asList("65046:10050"))) + .withOptionAProperties( + new OptionAProperties() + .withPrimaryIpv4Prefix("10.0.0.14/30") + .withPrimaryIpv6Prefix("2FFE:FFFF:0:CD30::a7/126") + .withSecondaryIpv4Prefix("10.0.0.15/30") + .withSecondaryIpv6Prefix("2FFE:FFFF:0:CD30::ac/126") + .withMtu(5892) + .withVlanId(2724) + .withPeerAsn(42666)))) + .withAnnotation("annotationValue") + .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/NetworkFabricsDeleteSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsDeleteSamples.java new file mode 100644 index 0000000000000..76b86010dc1af --- /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 0000000000000..1015ccef0da96 --- /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 0000000000000..7aff3dc3fed2d --- /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 0000000000000..c2490049ae88e --- /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 0000000000000..8a2a79bdeac81 --- /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 0000000000000..e4f9ba3ed8457 --- /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 0000000000000..3e8e5c006a6eb --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkFabricsUpdateSamples.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.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabric; +import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerPatchableProperties; +import java.util.HashMap; +import java.util.Map; + +/** 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() + .withTags(mapOf("key1758", "")) + .withTerminalServerConfiguration( + new TerminalServerPatchableProperties() + .withUsername("username") + .withPassword("fakeTokenPlaceholder") + .withSerialNumber("234567")) + .withAnnotation("annotationValue") + .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/NetworkInterfacesCreateSamples.java b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkInterfacesCreateSamples.java new file mode 100644 index 0000000000000..98573183b22cd --- /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 0000000000000..e16707faaf241 --- /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 0000000000000..8bf4458aa697a --- /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 0000000000000..7742d662097e6 --- /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 0000000000000..b5e61375b1133 --- /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 0000000000000..ad8c506af340f --- /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 0000000000000..2f138f87cc01a --- /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 0000000000000..816e3f36c7922 --- /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 0000000000000..70652b9da77cb --- /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 0000000000000..d2a15e0d6b976 --- /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 0000000000000..38ca23588bae3 --- /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 0000000000000..bc9c2a6970dc1 --- /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 0000000000000..2d4a94ec07a21 --- /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 0000000000000..ec273d4b35836 --- /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 0000000000000..0e12229ecb03e --- /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 0000000000000..07e84a716ad9f --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/NetworkToNetworkInterconnectsCreateSamples.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.BooleanEnumProperty; +import com.azure.resourcemanager.managednetworkfabric.models.Layer2Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.Layer3Configuration; +import com.azure.resourcemanager.managednetworkfabric.models.NniType; + +/** 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") + .withNniType(NniType.CE) + .withIsManagementType(BooleanEnumProperty.TRUE) + .withUseOptionB(BooleanEnumProperty.FALSE) + .withLayer2Configuration(new Layer2Configuration().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 0000000000000..65c3a48d0a8e2 --- /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 0000000000000..e29dd65de5422 --- /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 0000000000000..3f3f8f698ee46 --- /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 0000000000000..7be397106cf27 --- /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 0000000000000..cb6b324b9d56d --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesCreateSamples.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.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.ActionIpCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.ActionIpExtendedCommunityProperties; +import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes; +import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityIdList; +import com.azure.resourcemanager.managednetworkfabric.models.IpExtendedCommunityIdList; +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicyStatementProperties; +import com.azure.resourcemanager.managednetworkfabric.models.StatementActionProperties; +import com.azure.resourcemanager.managednetworkfabric.models.StatementConditionProperties; +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("routePolicyName") + .withRegion("EastUS") + .withExistingResourceGroup("rgRoutePolicies") + .withStatements( + Arrays + .asList( + new RoutePolicyStatementProperties() + .withAnnotation("annotationValue") + .withSequenceNumber(7L) + .withCondition( + new StatementConditionProperties() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")) + .withIpPrefixId( + "subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix") + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withAction( + new StatementActionProperties() + .withLocalPreference(20L) + .withActionType(CommunityActionTypes.PERMIT) + .withIpCommunityProperties( + new ActionIpCommunityProperties() + .withAdd( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName"))) + .withDelete( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName"))) + .withSet( + new IpCommunityIdList() + .withIpCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipCommunities/ipCommunityName")))) + .withIpExtendedCommunityProperties( + new ActionIpExtendedCommunityProperties() + .withAdd( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withDelete( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))) + .withSet( + new IpExtendedCommunityIdList() + .withIpExtendedCommunityIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/ipExtendedCommunityName"))))))) + .withTags(mapOf("key8254", "")) + .withAnnotation("annotationValue") + .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 0000000000000..d411559197d80 --- /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", "routePolicyName", 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 0000000000000..f336fba08b7c7 --- /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", "routePolicyName", 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 0000000000000..da8756f9f986a --- /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 0000000000000..6df6454587955 --- /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 0000000000000..0deab123509b8 --- /dev/null +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/src/samples/java/com/azure/resourcemanager/managednetworkfabric/generated/RoutePoliciesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.managednetworkfabric.generated; + +import com.azure.resourcemanager.managednetworkfabric.models.RoutePolicy; +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) { + RoutePolicy resource = + manager + .routePolicies() + .getByResourceGroupWithResponse( + "resourceGroupName", "routePolicyName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8254", "")).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 0000000000000..07af3d966b8a8 --- /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 0000000000000..fce68731aaab1 --- /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 + +